Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dockerfile for production #666

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 8 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
# Build stage

FROM node:18

ENV NODE_OPTIONS=--openssl-legacy-provider

# install node packages - cache for faster future builds
WORKDIR /src/nav-app
COPY ./nav-app/package*.json ./

# install packages and build
FROM node:18-alpine as builder
WORKDIR /usr/src/app
COPY /nav-app/package.json .
COPY /nav-app/package-lock.json .
RUN npm install

# copy over needed files
COPY ./nav-app/ ./

# copy layers directory
WORKDIR /src
COPY layers/ ./layers/

# copy markdown files from root
COPY *.md ./

WORKDIR /src/nav-app
EXPOSE 4200
COPY /nav-app .
RUN npm run build -- --configuration production

CMD npm start
FROM nginxinc/nginx-unprivileged:1.27-alpine3.19
COPY --from=builder /usr/src/app/dist/ /usr/share/nginx/html