Skip to content

Commit 6309549

Browse files
committed
Initial setup of dockerfiles and compose.yaml
Follow dockerfile for backend Add the redis/rabbitmq to compose as well
1 parent 61ac5cc commit 6309549

File tree

5 files changed

+115
-3
lines changed

5 files changed

+115
-3
lines changed

compose.yaml

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ services:
3030
path: user-service
3131
target: /user-service
3232

33-
3433
backend:
3534
build: backend
3635
env_file:
@@ -43,7 +42,74 @@ services:
4342
path: backend
4443
target: backend/app
4544

45+
# blob and mq
46+
redis:
47+
image: redis
48+
container_name: redis-peerprep
49+
extra_hosts:
50+
- "host.docker.internal:host-gateway"
51+
ports:
52+
- "9190:6379"
53+
54+
rabbitmq:
55+
image: rabbitmq:3-management
56+
container_name: rabbitmq
57+
environment:
58+
RABBITMQ_DEFAULT_USER: grp14
59+
RABBITMQ_DEFAULT_PASS: grp14
60+
extra_hosts:
61+
- "host.docker.internal:host-gateway"
62+
ports:
63+
- "9100:5672"
64+
- "9101:15672"
65+
66+
matching-service:
67+
build: matching-service
68+
env_file:
69+
- matching-service/.env
70+
extra_hosts:
71+
- "host.docker.internal:host-gateway"
72+
develop:
73+
watch:
74+
- action: rebuild
75+
path: matching-service
76+
target: matching-service/app
77+
depends_on:
78+
- rabbitmq
79+
- redis
80+
81+
matching-service-api:
82+
build: matching-service-api
83+
env_file:
84+
- matching-service-api/.env
85+
extra_hosts:
86+
- "host.docker.internal:host-gateway"
87+
ports:
88+
- "9200:9200"
89+
develop:
90+
watch:
91+
- action: rebuild
92+
path: matching-service
93+
target: matching-service/app
94+
depends_on:
95+
- rabbitmq
96+
97+
storage-blob-api:
98+
build: storage-blob-api
99+
env_file:
100+
- storage-blob-api/.env
101+
extra_hosts:
102+
- "host.docker.internal:host-gateway"
103+
ports:
104+
- "9300:9300"
105+
develop:
106+
watch:
107+
- action: rebuild
108+
path: storage-blob-api
109+
target: storage-blob-api/app
110+
depends_on:
111+
- redis
46112
# mongo:
47113
# image: "mongo:latest"
48114
# ports:
49-
# - "27017:27017"
115+
# - "27017:27017"

matching-service-api/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM golang:1.23
2+
3+
WORKDIR /matching-service-api
4+
5+
COPY go.mod go.sum ./
6+
RUN go mod download
7+
8+
COPY . .
9+
10+
# Build
11+
RUN CGO_ENABLED=0 GOOS=linux go build -o /matching-service-api/app
12+
13+
EXPOSE 9200
14+
15+
# Run
16+
CMD ["/matching-service-api/app"]

matching-service/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM golang:1.23
2+
3+
WORKDIR /matching-service
4+
5+
COPY go.mod go.sum ./
6+
RUN go mod download
7+
8+
COPY . .
9+
10+
# Build
11+
RUN CGO_ENABLED=0 GOOS=linux go build -o /matching-service/app
12+
13+
# Run
14+
CMD ["/matching-service/app"]

storage-blob-api/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM golang:1.23
2+
3+
WORKDIR /storage-blob-api
4+
5+
COPY go.mod go.sum ./
6+
RUN go mod download
7+
8+
COPY . .
9+
10+
# Build
11+
RUN CGO_ENABLED=0 GOOS=linux go build -o /storage-blob-api/app
12+
13+
EXPOSE 9300
14+
15+
# Run
16+
CMD ["/storage-blob-api/app"]

user-service/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WORKDIR /user-service
44
# TODO: don't include the .env file in the COPY
55
# TODO: multistage build
66
COPY package*.json ./
7-
RUN npm install
7+
RUN npm install --verbose
88
RUN npm rebuild bcrypt --build-from-source
99
COPY . .
1010
EXPOSE 3001

0 commit comments

Comments
 (0)