forked from Sparkmoons/backend-trainee-assignment-2024
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
50 lines (44 loc) · 1020 Bytes
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
version: '3.8'
services:
go-server:
build:
context: .
dockerfile: Dockerfile
ports:
- "${SERVER_PORT}:8080"
depends_on:
- postgres-db
- mongo-db
- redis-cache
container_name: ${SERVER_CONTAINER_NAME}
env_file:
- .env
postgres-db:
image: postgres:latest
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
volumes:
- postgres_data:/var/lib/postgresql/data
container_name: ${POSTGRES_CONTAINER_NAME}
mongo-db:
image: mongo:latest
ports:
- "${MONGO_PORT}:${MONGO_PORT}"
volumes:
- mongo_data:/data/db
container_name: ${MONGO_CONTAINER_NAME}
redis-cache:
image: redis:latest
ports:
- "${REDIS_PORT}:${REDIS_PORT}"
volumes:
- redis_data:/data
container_name: ${REDIS_CONTAINER_NAME}
volumes:
postgres_data:
mongo_data:
redis_data: