-
Notifications
You must be signed in to change notification settings - Fork 107
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
80 lines (71 loc) · 1.82 KB
/
docker-compose.yml
File metadata and controls
80 lines (71 loc) · 1.82 KB
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
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
volumes:
- ../..:/workspaces:cached
# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
depends_on:
- mysql
- redis
networks:
- cnpm
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
# networks:
# - cnpm
# Uncomment the next line to use a non-root user for all processes.
# user: node
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
redis:
image: redis:6-alpine
# command: redis-server --appendonly yes --requirepass cnpm
restart: always
volumes:
- cnpm-redis:/data
ports:
- 6379
networks:
- cnpm
mysql:
image: mariadb
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
# MYSQL_DATABASE: 'cnpmcore_unittest'
MYSQL_USER: user
MYSQL_PASSWORD: pass
volumes:
- cnpm-mysql:/var/lib/mysql
# - ./conf.d/mysql/:/etc/mysql/conf.d
# - ./init.d/mysql/:/docker-entrypoint-initdb.d
- ./sql:/docker-entrypoint-initdb.d/sql
- ./prepare-database.sh:/docker-entrypoint-initdb.d/init.sh
ports:
- 3306
networks:
- cnpm
# database explorer
adminer:
image: adminer
restart: always
environment:
ADMINER_DEFAULT_DB_HOST: 'mysql'
depends_on:
- mysql
ports:
- 8080
networks:
- cnpm
volumes:
cnpm-redis:
cnpm-mysql:
networks:
cnpm:
name: cnpm
driver: bridge