Skip to content

Commit 4b788f1

Browse files
committed
feat: update docker setup commands
1 parent 1acef94 commit 4b788f1

File tree

6 files changed

+8
-14
lines changed

6 files changed

+8
-14
lines changed

apps/docker-compose.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ services:
1616
build:
1717
context: ./user-service
1818
dockerfile: Dockerfile
19-
args:
20-
DB_CLOUD_URI: ${DB_CLOUD_URI}
21-
JWT_SECRET: ${JWT_SECRET}
2219
ports:
2320
- 3001:3001
2421
networks:

apps/frontend/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ You can start editing the page by modifying `app/page.tsx`. The page auto-update
4242
```sh
4343
# Navigate to the frontend app directory
4444
cd apps/frontend
45+
4546
# Build dockerfile (Ensure that your docker daemon is running beforehand)
4647
docker build -t frontend -f Dockerfile .
4748
```
@@ -52,7 +53,7 @@ Run the backend server locally and visit http://localhost:3000/ to see the front
5253

5354
```sh
5455
# Run the docker image, the -d tag is to run it detached
55-
docker run -p 3000:3000 -d frontend -e NEXT_PUBLIC_QUESTION_SERVICE_URL="http://localhost:8080/"
56+
docker run -p 3000:3000 --env-file .env -d frontend
5657

5758
# To see the running container
5859
docker ps

apps/question-service/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ WORKDIR /usr/src/app
44

55
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
66
COPY go.mod go.sum ./
7+
78
RUN go mod tidy && go mod download && go mod verify
89

910
COPY . .

apps/question-service/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ docker build -t question-service .
5858
```
5959

6060
```bash
61-
docker run -p 8080:8080 -d question-service
61+
docker run -p 8080:8080 --env-file .env -d question-service
6262
```
6363

6464
The server will be available at http://localhost:8080.

apps/user-service/Dockerfile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
FROM node:20-alpine AS base
22

3-
ARG DB_CLOUD_URI
4-
ARG JWT_SECRET
5-
ENV DB_CLOUD_URI=${DB_CLOUD_URI}
6-
ENV JWT_SECRET=${JWT_SECRET}
7-
ENV ENV=PROD
8-
93
FROM base AS deps
104

115
WORKDIR /app

apps/user-service/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,16 @@
286286
```bash
287287
# Navigate to the user-service app directory
288288
cd apps/user-service
289-
# Build dockerfile after replacing the build arguments (Ensure that your docker daemon is running beforehand)
290-
docker build -t user-service --build-arg JWT_SECRET='replace_with_jwt_secret' --build-arg DB_CLOUD_URI='replace_with_db_uri_here' -f Dockerfile .
289+
290+
# Build dockerfile (Ensure that your docker daemon is running beforehand)
291+
docker build -t user-service -f Dockerfile .
291292
```
292293

293294
### Running Docker
294295

295296
```bash
296297
# Run the docker image, the -d tag is to run it detached
297-
docker run -p 3001:3001 -d user-service
298+
docker run -p 3001:3001 --env-file .env -d user-service
298299

299300
# To check the container information
300301
docker ps

0 commit comments

Comments
 (0)