-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
68 lines (64 loc) · 1.39 KB
/
docker-compose.yml
File metadata and controls
68 lines (64 loc) · 1.39 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
services:
# API service
api:
build:
context: deploy/
dockerfile: API.Dockerfile
depends_on:
memcached:
condition: service_healthy
db:
condition: service_healthy
ports:
- "5001:80"
volumes:
- type: bind
source: ./htdocs/
target: /var/www/html/
container_name: rs_api_api
networks:
- rs_network
healthcheck:
test: ["CMD", "apache2ctl", "-M"]
start_period: 30s
interval: 15s
timeout: 5s
retries: 3
# Database
db:
build:
context: deploy/
dockerfile: MySQL.Dockerfile
volumes:
- db_data:/var/lib/mysql
restart: always
ports:
- "3306:3306"
container_name: rs_api_db
networks:
- rs_network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-ppassword"]
start_period: 30s
interval: 15s
timeout: 5s
retries: 3
# Memcached for sessions/cache
memcached:
image: memcached:1.6-alpine
command: ["memcached", "-m", "128", "-p", "11211", "-u", "memcache"]
ports:
- "11211:11211"
container_name: rs_api_memcached
networks:
- rs_network
healthcheck:
test: ["CMD-SHELL", "nc -z 127.0.0.1 11211 || exit 1"]
interval: 10s
timeout: 5s
retries: 3
volumes:
db_data: {}
networks:
rs_network:
driver: bridge