zakscode/Dockerfile

22 lines
490 B
Docker
Raw Normal View History

2024-01-04 19:56:46 -05:00
FROM node:20-alpine 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
2024-01-04 19:56:46 -05:00
RUN mkdir /app
2022-05-02 21:10:15 -04:00
WORKDIR /app
COPY . .
2024-01-04 19:56:46 -05:00
# Build
RUN if [ ! -d "dist" ]; then npm install && npm run build; fi
2022-05-02 21:10:15 -04:00
# Use Nginx to serve
2024-12-30 12:05:38 -05:00
FROM git.zakscode.com/ztimson/momentum:latest
RUN rm -rf /app/server/public/assets /app/server/public/index.html
COPY --from=build /app/dist /app/server/public