Skip to content

Commit 839bb10

Browse files
committed
feat: add heroku with caddy
1 parent ea8e42e commit 839bb10

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,5 @@ jobs:
7979
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
8080
heroku_app_name: "dsomm"
8181
heroku_email: timo.pagel@owasp.org
82-
branch: ${{ env.HEROKU_BRANCH }}
82+
branch: ${{ env.HEROKU_BRANCH }}
83+
usedocker: true

Caddyfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
http_port {$PORT}
3+
}
4+
5+
localhost:{$PORT} {
6+
encode gzip
7+
log stdout
8+
file_server
9+
}

Dockerfile

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,9 @@ RUN npm run build
99

1010
FROM wurstbrot/dsomm-yaml-generation as yaml
1111

12-
FROM nginx:alpine
12+
FROM caddy
13+
ENV PORT 8080
1314

14-
RUN chown -R nginx:nginx /var/cache/nginx \
15-
&& chown -R nginx:nginx /var/log/nginx \
16-
&& touch /var/run/nginx.pid \
17-
&& chown -R nginx:nginx /var/run/nginx.pid
18-
19-
COPY --from=yaml ["/var/www/html/src/assets/YAML/generated/generated.yaml", "/usr/share/nginx/html/assets/YAML/generated/generated.yaml"]
20-
COPY ["nginx/default.conf", "/etc/nginx/conf.d/"]
21-
COPY --from=build ["/usr/src/app/dist/dsomm/", "/usr/share/nginx/html/"]
22-
23-
USER nginx
15+
COPY Caddyfile /etc/caddy/Caddyfile
16+
COPY --from=build ["/usr/src/app/dist/dsomm/", "/srv"]
17+
COPY --from=yaml ["/var/www/html/src/assets/YAML/generated/generated.yaml", "/srv/assets/YAML/generated/generated.yaml"]

0 commit comments

Comments
 (0)