-
Notifications
You must be signed in to change notification settings - Fork 12
/
docker-compose.yml
46 lines (43 loc) · 1.04 KB
/
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
services:
goserver:
build:
context: .
dockerfile: Dockerfile
image: goserver
container_name: goserver
restart: unless-stopped
env_file: .env
ports:
- '${SERVER_PORT}:8080'
depends_on:
- mongo
- redis
mongo:
image: mongo:7.0.12
container_name: mongo
restart: unless-stopped
env_file: .env
environment:
- MONGO_INITDB_ROOT_USERNAME=${DB_ADMIN}
- MONGO_INITDB_ROOT_PASSWORD=${DB_ADMIN_PWD}
- MONGO_INITDB_DATABASE=${DB_NAME}
ports:
- '${DB_PORT}:27017'
command: mongod --bind_ip_all
volumes:
- ./.extra/setup/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
- dbdata:/data/db
redis:
image: redis:7.2.5
container_name: redis
restart: unless-stopped
env_file: .env
ports:
- '${REDIS_PORT}:6379'
command: redis-server --bind localhost --bind 0.0.0.0 --save 20 1 --loglevel warning --requirepass ${REDIS_PASSWORD}
volumes:
- cache:/data/cache
volumes:
dbdata:
cache:
driver: local