forked from mendhak/docker-http-https-echo
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (24 loc) · 643 Bytes
/
Dockerfile
File metadata and controls
27 lines (24 loc) · 643 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM node:16-alpine AS build
WORKDIR /app
COPY . /app
RUN set -ex \
# Build JS-Application
&& npm install --production \
# Generate SSL-certificate (for HTTPS)
&& apk --no-cache add openssl \
&& sh generate-cert.sh \
&& apk del openssl \
&& rm -rf /var/cache/apk/* \
# Delete unnecessary files
&& rm package* generate-cert.sh \
# Correct User's file access
&& chown -R node:node /app \
&& chmod +r /app/privkey.pem
FROM node:16-alpine AS final
WORKDIR /app
COPY --from=build /app /app
ENV HTTP_PORT=8080 HTTPS_PORT=8443
ENV JWT_HEADER=authorization
EXPOSE $HTTP_PORT $HTTPS_PORT
USER 1000
CMD ["node", "./index.js"]