Skip to content

Commit

Permalink
Merge pull request #956 from Code4GovTech/feat/docker-deployment-update
Browse files Browse the repository at this point in the history
docker deployment update
  • Loading branch information
tushar5526 authored Jun 7, 2024
2 parents 3ac26d2 + 7eb66b7 commit d368d99
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,23 @@ WORKDIR /opt/docusaurus
COPY . /opt/docusaurus/
## Install dependencies with `--immutable` to ensure reproducibility.
RUN npm ci

ARG API_BASE_URL
ARG API_AUTH_KEY

ENV API_BASE_URL=$API_BASE_URL
ENV API_AUTH_KEY=$API_AUTH_KEY

## Build the static site.
RUN npm run build

# Stage 3a: Serve with `docusaurus serve`.
FROM prod as serve
## Expose the port that Docusaurus will run on.
EXPOSE 3000

ENV NODE_ENV=production
ENV API_BASE_URL=$API_BASE_URL
ENV API_AUTH_KEY=$API_AUTH_KEY
## Run the production server.
CMD ["npm", "run", "serve", "--", "--host", "0.0.0.0"]
7 changes: 6 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ services:
serve:
build:
context: .
args:
API_BASE_URL: ${API_BASE_URL}
API_AUTH_KEY: ${API_AUTH_KEY}
target: serve
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- NODE_ENV=production
- API_BASE_URL=${API_BASE_URL}
- API_AUTH_KEY=${API_AUTH_KEY}

0 comments on commit d368d99

Please sign in to comment.