Skip to content

Commit d368d99

Browse files
authored
Merge pull request #956 from Code4GovTech/feat/docker-deployment-update
docker deployment update
2 parents 3ac26d2 + 7eb66b7 commit d368d99

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,23 @@ WORKDIR /opt/docusaurus
1717
COPY . /opt/docusaurus/
1818
## Install dependencies with `--immutable` to ensure reproducibility.
1919
RUN npm ci
20+
21+
ARG API_BASE_URL
22+
ARG API_AUTH_KEY
23+
24+
ENV API_BASE_URL=$API_BASE_URL
25+
ENV API_AUTH_KEY=$API_AUTH_KEY
26+
2027
## Build the static site.
2128
RUN npm run build
2229

2330
# Stage 3a: Serve with `docusaurus serve`.
2431
FROM prod as serve
2532
## Expose the port that Docusaurus will run on.
2633
EXPOSE 3000
34+
35+
ENV NODE_ENV=production
36+
ENV API_BASE_URL=$API_BASE_URL
37+
ENV API_AUTH_KEY=$API_AUTH_KEY
2738
## Run the production server.
2839
CMD ["npm", "run", "serve", "--", "--host", "0.0.0.0"]

docker-compose.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ services:
33
serve:
44
build:
55
context: .
6+
args:
7+
API_BASE_URL: ${API_BASE_URL}
8+
API_AUTH_KEY: ${API_AUTH_KEY}
69
target: serve
710
ports:
811
- "3000:3000"
912
environment:
10-
- NODE_ENV=production
13+
- NODE_ENV=production
14+
- API_BASE_URL=${API_BASE_URL}
15+
- API_AUTH_KEY=${API_AUTH_KEY}

0 commit comments

Comments
 (0)