This repository has been archived by the owner on Oct 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdocker-compose.release.yml
108 lines (103 loc) · 2.85 KB
/
docker-compose.release.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
version: '3'
services:
# 数据库
# mysql:
# image: mysql:5.7.26 # 固定版本
# # restart: always # 重启系统后重启容器
# environment:
# - TZ=Asia/Shanghai
# - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} # 只在数据库未初始化的情况下有效
# volumes:
# - ${DATABASE_DATA_DIR}/mysql:/var/lib/mysql
mongo:
image: mongo:4.0
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
volumes:
- ${DATABASE_DATA_DIR}/mongo:/data/db
redis:
image: redis:5.0-alpine
volumes:
- ${DATABASE_DATA_DIR}/redis:/data # redis 数据存储在容器的 /data 下
# 数据库管理工具
# adminer: # MySQL 管理
# image: adminer:latest
# ports:
# - 8080:8080
# depends_on:
# - mysql
# mongo-express: # Mongo 管理
# image: mongo-express:latest
# ports:
# - 8078:8081
# environment:
# ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_INITDB_ROOT_USERNAME}
# ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
# depends_on:
# - mongo
# redis-commander: # redis 管理
# image: rediscommander/redis-commander:latest
# environment:
# - REDIS_HOSTS=local:redis:6379
# ports:
# - 8079:8081
# depends_on:
# - redis
# go-app
go-app-web: # 不在docker中编译,需要先执行 build-go.sh
image: alpine:3.10
environment:
- CONF_FILE=/root/conf/app.yml
working_dir: /root
command: ./app
volumes:
- /etc/localtime:/etc/localtime:ro
- ./bin/web/app:/root/app:ro
- ./conf/app.release.yml:/root/conf/app.yml:ro
- ./resource:/root/resource
depends_on:
#- mysql
- mongo
- redis
# go-app-web: # 在docker中编译
# build:
# context: ./go
# # 相对于 context
# dockerfile: ../docker/go-app-web/Dockerfile
# environment:
# - CONF_FILE=/root/conf/app.yml
# command: ./app
# volumes:
# - ./conf/app.release.yml:/root/conf/app.yml:ro
# depends_on:
# - mysql
# - mongo
# - redis
# py-app
py-app-celery:
build:
context: ./py
dockerfile: ../docker/py-app-celery/Dockerfile
environment:
- CONF_FILE=/root/conf/app.yml
command: python3 -m celery -A task worker --concurrency=3
volumes:
- /etc/localtime:/etc/localtime:ro
- ./py/celery/task:/root/task:ro
- ./conf/app.release.yml:/root/conf/app.yml:ro
- ./resource:/root/resource
depends_on:
#- mysql
- mongo
- redis
# nginx
nginx:
image: nginx:stable-alpine
ports:
- 3389:80
volumes:
- ./conf/nginx.release.conf:/etc/nginx/nginx.conf:ro
- ./resource:/usr/share/nginx/resource:ro
depends_on:
- go-app-main