-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
34 lines (33 loc) · 1.09 KB
/
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
FROM node:18.12.1-alpine AS build
WORKDIR /app
COPY package.json package-lock.json audit-resolve.json ./
RUN npm install -g npm-audit-resolver@next
RUN npm set progress=false && \
npm config set depth 0 && \
npm ci --legacy-peer-deps
RUN check-audit --omit=dev --audit-level=moderate
COPY babel.config.js tsconfig.json tsconfig.test.json tsconfig.webpack.json jest.config.js ./
COPY webpack ./webpack
COPY test ./test
COPY src ./src
RUN npm test
ARG NAMESPACE
RUN npm run build:prod
FROM nginx:alpine
WORKDIR /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
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 ./
COPY --chown=app:app /sitemap/robots.txt ./
COPY --chown=app:app /sitemap/sitemap.xml ./
RUN dos2unix entrypoint.sh && chmod +x entrypoint.sh
ENTRYPOINT [ "./entrypoint.sh" ]
EXPOSE 8080