-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
136 lines (129 loc) · 3.55 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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
version: '3.8'
volumes:
dbdata:
services:
frontend:
image: node:18-alpine
working_dir: /frontend/
volumes:
- type: bind
source: ${KJA_LOCAL_WS-.}/frontend/package.json
target: /frontend/package.json
- type: bind
source: ${KJA_LOCAL_WS-.}/frontend/package-lock.json
target: /frontend/package-lock.json
- type: bind
source: ${KJA_LOCAL_WS-.}/frontend/src
target: /frontend/src
- type: bind
source: ${KJA_LOCAL_WS-.}/frontend/public
target: /frontend/public
- type: bind
source: ${KJA_LOCAL_WS-.}/frontend/index.html
target: /frontend/index.html
- type: bind
source: ${KJA_LOCAL_WS-.}/frontend/tsconfig.node.json
target: /frontend/tsconfig.node.json
- type: bind
source: ${KJA_LOCAL_WS-.}/frontend/vite.config.ts
target: /frontend/vite.config.ts
- type: bind
source: ${KJA_LOCAL_WS-.}/frontend/tsconfig.json
target: /frontend/tsconfig.json
- type: bind
source: ${KJA_LOCAL_WS-.}/frontend/.eslintrc.yml
target: /frontend/.eslintrc.yml
- type: bind
source: ${KJA_LOCAL_WS-.}/frontend/.prettierrc.yml
target: /frontend/.prettierrc.yml
tty: true
ports:
- 3000:3000
command: >
sh -c "npm install &&
npm start"
postgresql:
image: postgres:15-alpine
ports:
- 5432:5432
volumes:
- dbdata:/var/lib/postgresql/data
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: pass
POSTGRES_DB: test-db
restart: always
backend:
image: eclipse-temurin:17-jdk-focal
ports:
- 55050:5050
working_dir: /backend/
volumes:
- type: bind
source: ${KJA_LOCAL_WS-.}/backend/src
target: /backend/src
- type: bind
source: ${KJA_LOCAL_WS-.}/backend/gradle
target: /backend/gradle/
- type: bind
source: ${KJA_LOCAL_WS-.}/backend/gradlew
target: /backend/gradlew
- type: bind
source: ${KJA_LOCAL_WS-.}/backend/build.gradle
target: /backend/build.gradle
- type: bind
source: ${KJA_LOCAL_WS-.}/backend/settings.gradle
target: /backend/settings.gradle
environment:
TZ: Asia/Tokyo
SLACK_TOKEN: ${SLACK_TOKEN}
SLACK_CHANNEL: ${SLACK_CHANNEL}
depends_on:
- postgresql
command:
- ./gradlew
- bootRun
nginx:
image: nginx:alpine
ports:
- '80:80'
command: [nginx-debug, '-g', 'daemon off;']
volumes:
- type: bind
source: ${KJA_LOCAL_WS-.}/nginx/default.conf
target: /etc/nginx/conf.d/default.conf
depends_on:
- frontend
- backend
- postgresql
backup:
build: ./backup
init: true
environment:
PGUSER: admin
PGPASSWORD: pass
PGDATABASE: test-db
PGHOST: postgresql
BACKUP_HOST: ${BACKUP_HOST}
BACKUP_USER: ${BACKUP_USER}
volumes:
- type: bind
source: ${KJA_LOCAL_WS-.}/backup/cron-config
target: /etc/crontabs/root
- type: bind
source: ${KJA_LOCAL_WS-.}/backup/backup.sh
target: /root/backup.sh
- type: bind
source: ${KJA_LOCAL_WS-.}/secret/private_key
target: /root/.ssh/private_key
restore-db:
image: postgres:15-alpine
volumes:
- dbdata:/var/lib/postgresql/data
- ${KJA_LOCAL_WS-.}/restore.sql:/docker-entrypoint-initdb.d/restore.sql
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: pass
POSTGRES_DB: test-db
profiles:
- restore