zakscode/Dockerfile

23 lines
502 B
Docker
Raw Normal View History

2024-01-03 23:49:28 -05:00
FROM node as build
2022-05-02 21:10:15 -04:00
# Variables
ARG NODE_ENV=prod
2024-01-03 23:49:28 -05:00
ARG NODE_OPTIONS="--max_old_space_size=4096"
2022-05-02 21:10:15 -04:00
ENV NG_CLI_ANALYTICS=ci \
NODE_ENV=${NODE_ENV} \
NODE_OPTIONS=${NODE_OPTIONS}
# Setup
WORKDIR /app
COPY . .
2022-05-02 21:49:10 -04:00
# Install & build
2024-01-03 23:49:28 -05:00
RUN if [ ! -d "dist" ]; then npm ci && npm run build; fi
2022-05-02 21:10:15 -04:00
# Use Nginx to serve
FROM nginx:1.20-alpine
2024-01-03 23:49:28 -05:00
COPY --from=build /app/dist/browser /usr/share/nginx/html
2022-05-02 21:10:15 -04:00
COPY docker/robots.txt /usr/share/nginx/html/robots.txt
COPY docker/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80