-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
59 lines (54 loc) · 1.46 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
47
48
49
50
51
52
53
54
55
56
57
58
59
version: "3.8"
services:
app:
build:
context: .
dockerfile: Dockerfile
image: url-shortener
container_name: url-shortener
restart: unless-stopped
working_dir: /var/www
volumes:
- .:/var/www
- ./docker-compose/php/local.ini:/usr/local/etc/php/conf.d/local.ini # PHP config if needed
networks:
- url-shortener-network
depends_on:
- db
environment:
SERVICE_NAME: app
SERVICE_TAGS: dev
db:
image: mysql:8.0
container_name: url-shortener-db
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: url_shortener
MYSQL_USER: user
MYSQL_PASSWORD: password
ports:
- "3306:3306"
volumes:
- db-data:/var/lib/mysql
networks:
- url-shortener-network
nginx:
image: nginx:alpine
container_name: url-shortener-nginx
restart: unless-stopped
ports:
- "80:80" # HTTP port
# - "443:443" # Uncomment this for HTTPS (SSL) support
volumes:
- .:/var/www:cached
- ./docker-compose/nginx:/etc/nginx/conf.d
depends_on:
- app
networks:
- url-shortener-network
networks:
url-shortener-network:
driver: bridge
volumes:
db-data: