-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from SJSUCSClub/130-feature-add-production-do…
…ckerfile [Feature] Add Production Dockerfile
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 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,31 @@ | ||
FROM node:20.17 | ||
|
||
WORKDIR /client | ||
|
||
# install stage | ||
COPY package-lock.json package-lock.json | ||
COPY package.json package.json | ||
RUN npm i | ||
|
||
# build stage | ||
COPY app app | ||
COPY assets assets | ||
COPY components components | ||
COPY types types | ||
COPY utils utils | ||
COPY wrappers wrappers | ||
COPY .eslintrc.json .eslintrc.json | ||
COPY postcss.config.mjs postcss.config.mjs | ||
COPY tailwind.config.ts tailwind.config.ts | ||
COPY tsconfig.json tsconfig.json | ||
COPY next.config.mjs next.config.mjs | ||
|
||
ARG BASE_API_URL | ||
ARG NEXT_PUBLIC_BASE_URL | ||
ENV BASE_API_URL=${BASE_API_URL} | ||
ENV NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL} | ||
RUN npm run build | ||
|
||
# run | ||
EXPOSE 3000 | ||
CMD [ "npm", "start" ] |
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,10 @@ | ||
name: next-client-prod | ||
services: | ||
client: | ||
build: | ||
dockerfile: Dockerfile | ||
args: | ||
- BASE_API_URL=${BASE_API_URL?REQUIRED} | ||
- NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL?REQUIRED} | ||
ports: | ||
- 3000:3000 |