1
1
Fork 0
portfolio/Dockerfile

18 lines
393 B
Text
Raw Normal View History

2024-03-05 20:39:14 +00:00
# build with nodejs
2024-03-27 06:24:52 +00:00
FROM node:18.19-alpine3.18 AS build
2024-03-05 20:39:14 +00:00
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
2024-03-27 00:04:07 -05:00
RUN npm run optimize
2024-03-05 20:39:14 +00:00
# serve compiled files with local nginx config
FROM nginx:alpine
WORKDIR /app
COPY --from=build /app/_site .
COPY ./nginx.conf /etc/nginx/nginx.conf