portfolio/Dockerfile
2024-03-27 06:24:52 +00:00

18 lines
393 B
Docker

# build with nodejs
FROM node:18.19-alpine3.18 AS build
ENV NODE_ENV production
WORKDIR /app
COPY . /app
RUN mkdir -p _site node_modules
RUN chown -R node:node .
USER node
RUN NODE_ENV=development npm ci
RUN npm run build
RUN npm run optimize
# serve compiled files with local nginx config
FROM nginx:alpine
WORKDIR /app
COPY --from=build /app/_site .
COPY ./nginx.conf /etc/nginx/nginx.conf