-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
74 lines (69 loc) · 1.7 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
services:
girls-side-analysis-nextjs:
build:
dockerfile: ./Dockerfile.nextjs
container_name: girls-side-analysis-nextjs-dev
environment:
TZ: 'Asia/Tokyo'
volumes:
- .env.development:/app/.env
- .:/app
tmpfs:
- /app/.next
database:
build:
dockerfile: ./Dockerfile.mysql
container_name: girls-side-analysis-database
env_file:
- .env.development
# 注. テスト用、データは永続しない
tmpfs:
- /var/lib/mysql
environment:
TZ: 'Asia/Tokyo'
LANG: 'ja_JP.UTF-8'
cap_add:
- SYS_NICE
healthcheck:
test: mysql -u $$MYSQL_USER -p$$MYSQL_PASSWORD $$MYSQL_DATABASE -e "select 1;"
interval: 5s
timeout: 20s
retries: 3
start_period: 5s
database-preparation:
image: node:20
#build:
# dockerfile: ./Dockerfile.database-preparation
container_name: girls-side-analysis-database-preparation
env_file:
- .env.development
environment:
NODE_ENV: 'development'
volumes:
- ./:/app:ro
working_dir: /app
command: >
bash -c '
npm install -g pnpm \
&& pnpm drizzle-kit push \
--dialect=mysql \
--schema=./src/db/schema.ts \
--host=$$DB_HOST \
--user=$$MYSQL_USER \
--password=$$MYSQL_PASSWORD \
--database=$$MYSQL_DATABASE; \
pnpm tsx addTestData.ts
'
depends_on:
database:
condition: service_healthy
webserver:
image: nginx
container_name: girls-side-analysis-webserver
ports:
- 80:80
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
networks:
default:
name: girls-side-analysis-network