Skip to content

Instantly share code, notes, and snippets.

@ScriptBytes
Last active February 27, 2022 18:01
Show Gist options
  • Save ScriptBytes/61d4f6a9f9d68a49245705904519bf32 to your computer and use it in GitHub Desktop.
Save ScriptBytes/61d4f6a9f9d68a49245705904519bf32 to your computer and use it in GitHub Desktop.
FROM node:16.14.0 as build
WORKDIR /source
# Copy the package lock file into the container
COPY package*.json ./
# Run ci only for the production dependencies
RUN npm ci
# Copy the rest of the files into the container and build
COPY . .
RUN npm run build --prod
FROM nginx:alpine
COPY --from=build /source/dist/todo /usr/share/nginx/html
COPY --from=build /source/nginx.conf /etc/nginx/conf.d/
EXPOSE 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment