Skip to content

Commit

Permalink
Merge pull request #131 from SJSUCSClub/130-feature-add-production-do…
Browse files Browse the repository at this point in the history
…ckerfile

[Feature] Add Production Dockerfile
  • Loading branch information
chrehall68 authored Oct 14, 2024
2 parents 76e4c3a + c9f62cb commit 6bec758
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Dockerfile
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" ]
10 changes: 10 additions & 0 deletions docker-compose.yml
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

0 comments on commit 6bec758

Please sign in to comment.