-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
92 lines (84 loc) · 1.91 KB
/
docker-compose.yml
File metadata and controls
92 lines (84 loc) · 1.91 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
81
82
83
84
85
86
87
88
89
90
91
version: '3'
services:
# NGINX for generic web service
nginx:
image: nginx:latest
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl/localhost.crt:/etc/ssl/certs/localhost.crt
- ./ssl/localhost.key:/etc/ssl/private/localhost.key
networks:
- frontend
# MongoDB service
mongo:
container_name: mongo
image: mongo:latest
volumes:
- mongo-data:/data/db
networks:
- backend
# MongoDB express admin UI
mongo-express:
container_name: mongo-express
image: mongo-express:latest
environment:
ME_CONFIG_MONGODB_SERVER: mongo
ME_CONFIG_MONGODB_PORT: 27017
ports:
- "8081:8081"
networks:
- backend
# MySQL service for WordPress
mysql:
container_name: mysql
image: mysql:latest
environment:
- MYSQL_DATABASE=wordpressdb
- MYSQL_USER=wordpressuser
- MYSQL_PASSWORD=secretpassword
- MYSQL_RANDOM_ROOT_PASSWORD=yes
volumes:
- mysqldata:/var/lib/mysql
networks:
- backend
# WordPress service
wordpress:
container_name: wordpress
image: wordpress:latest
depends_on:
- mysql
environment:
- WORDPRESS_DB_HOST=mysql
- WORDPRESS_DB_USER=wordpressuser
- WORDPRESS_DB_PASSWORD=secretpassword
- WORDPRESS_DB_NAME=wordpressdb
volumes:
- wordpressdata:/var/www/html
networks:
- backend
- frontend
# NGINX as a reverse proxy for WordPress
proxy:
container_name: proxy
image: nginx:latest
depends_on:
- wordpress
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl/localhost.crt:/etc/ssl/certs/localhost.crt
- ./ssl/localhost.key:/etc/ssl/private/localhost.key
ports:
- "80:80"
- "443:443"
networks:
- frontend
networks:
backend:
frontend:
volumes:
mongo-data:
mysqldata:
wordpressdata: