-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (33 loc) · 1009 Bytes
/
Dockerfile
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
28
29
30
31
32
33
34
35
FROM node:18.12.1 AS build
RUN mkdir /app
WORKDIR /app
COPY package.json package-lock.json ./
COPY audit-resolve.json ./
RUN npm install -g npm-audit-resolver@next
RUN npm set progress=false && \
npm config set depth 0 && \
npm ci
RUN check-audit --production --audit-level=moderate
COPY babel.config.js tsconfig.json tsconfig.webpack.json jest.config.js ./
COPY webpack ./webpack
COPY test ./test
COPY src ./src
RUN npm test
RUN npm run build:prod
FROM nginx:alpine
RUN mkdir /app
RUN addgroup -g 1001 -S app && \
adduser -u 1001 -S app -G app && \
chown -R app:app /app && \
chown -R app:app /var/cache/nginx && \
touch /var/run/nginx.pid && \
chown -R app:app /var/run/nginx.pid && \
chmod 770 /app
USER app:app
WORKDIR /app
COPY --chown=app:app nginx.conf /etc/nginx/conf.d/default.conf
COPY --chown=app:app --from=build /app/dist ./
COPY --chown=app:app entrypoint.sh config.template.js ./
RUN dos2unix entrypoint.sh && chmod +x entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]
EXPOSE 8080