-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
16 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
.next | ||
|
||
.dockerignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] |