-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
98 lines (91 loc) · 2.36 KB
/
docker-compose.yml
File metadata and controls
98 lines (91 loc) · 2.36 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
92
93
94
95
96
97
98
services:
# Image downloader service
image-init:
image: alpine:latest
volumes:
- ./sample-data/images:/images
command: >
sh -c "
mkdir -p /images &&
if [ ! -f /images/.initialized ]; then
echo 'Downloading sample images...' &&
wget -O /tmp/sample_images.tar.gz https://images.compodio.com/sample_show_images.tar.gz &&
mkdir /images/shows &&
tar -xzf /tmp/sample_images.tar.gz -C /images/shows &&
rm /tmp/sample_images.tar.gz &&
touch /images/.initialized &&
echo 'Images downloaded and extracted successfully.'
else
echo 'Images already initialized, skipping download.'
fi
"
# Next.js Frontend
frontend:
build:
context: ./frontend
ports:
- "3000:3000"
volumes:
- ./frontend:/app
- /app/node_modules
- ./sample-data/images:/app/public/images
depends_on:
- api
- image-init
environment:
- NEXT_PUBLIC_API_URI=${NEXT_PUBLIC_API}
- NEXT_PUBLIC_FEED_URI=${NEXT_PUBLIC_FEED}
- NEXT_PUBLIC_IMAGE_SERVER_URI=${NEXT_PUBLIC_IMAGE_SERVER_URI}
- NEXT_PUBLIC_GA_MEASUREMENT_ID=${NEXT_PUBLIC_GA_MEASUREMENT_ID}
# PHP API
api:
build:
context: ./api
ports:
- "8000:80"
volumes:
- ./api:/var/www/html
depends_on:
- db
environment:
- DB_HOST=db
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_PORT=${DB_DOCKER_PORT}
- DB_NAME=${DB_NAME}
# MySQL Database
db:
image: mysql:8.0
ports:
- "${DB_LOCAL_PORT}:${DB_DOCKER_PORT}"
volumes:
- mysql_data:/var/lib/mysql
- ./db:/docker-entrypoint-initdb.d
environment:
- MYSQL_TCP_PORT=${DB_DOCKER_PORT}
- MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
- MYSQL_DATABASE=${DB_NAME}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASSWORD}
# Python Scraper
scraper:
build:
context: ./scraper
volumes:
- ./scraper:/app
- ./sample-data/images:/app/images
- ./db:/app/db
depends_on:
- db
environment:
- IMAGE_PATH=/app/images
- DB_EXPORT_PATH=/app/db
- DEV_MODE=true
- DB_HOST=db
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_NAME=${DB_NAME}
- DB_PORT=${DB_DOCKER_PORT}
volumes:
mysql_data:
# image_data: