Skip to content

Commit

Permalink
repush dockerfile improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Highfire1 committed Apr 18, 2024
1 parent 396d76b commit a52036c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
4 changes: 4 additions & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.next

.dockerignore
19 changes: 12 additions & 7 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
FROM node:21
WORKDIR /usr/src/app
FROM node:lts-bookworm-slim
USER node
WORKDIR /home/src/app

COPY . ./
# Due to Docker's caching system this makes rebuilding the docker image much faster
COPY package.json package.json
COPY package-lock.json package-lock.json
RUN yarn install --production --immutable --immutable-cache && yarn cache clean

COPY . .
RUN yarn build

# TODO: currently, we're committing secrets to the built image as it is neccessary for the API
# this should not be done and instead the secrets should be injected into the running image
ARG APIURL
ARG APIKEY

ENV APIURL=${APIURL}
ENV APIKEY=${APIKEY}

# building the app
RUN yarn install
RUN yarn run build

# Running the app
CMD [ "yarn", "start" ]

0 comments on commit a52036c

Please sign in to comment.