File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export class HttpServer {
30
30
}
31
31
32
32
listen ( ) : void {
33
- // TODO: dynamic port
34
- this . server . listen ( 8080 , ( ) => debug ( 'Server is up and running on port %s' , 8080 ) ) ;
33
+ const port = process . env . PORT || 8080 ;
34
+ this . server . listen ( port , ( ) => debug ( 'Server is up and running on port %s' , port ) ) ;
35
35
}
36
36
}
Original file line number Diff line number Diff line change @@ -20,4 +20,6 @@ FROM nginx:alpine
20
20
WORKDIR /app
21
21
22
22
COPY --from=build-env /app/dist/smudgy /usr/share/nginx/html
23
- COPY --from=build-env /app/config/nginx.conf /etc/nginx/conf.d/default.conf
23
+ COPY --from=build-env /app/config/nginx.conf /etc/nginx/conf.d/default.template
24
+
25
+ CMD sh -c "envsubst \" `env | awk -F = '{printf \" \\\\ $%s\" , $1}'`\" < /etc/nginx/conf.d/default.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
Original file line number Diff line number Diff line change 1
1
server {
2
- listen 80 ;
2
+ listen ${NGINX_PORT} ;
3
3
4
4
# add mime types if needed:
5
5
include mime.types;
You can’t perform that action at this time.
0 commit comments