forked from algertc/ALPR-Database
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
59 lines (56 loc) · 1.56 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:
image: algertc/alpr-dashboard:latest
restart: unless-stopped
ports:
- "3000:3000" # Change the first port to the port you want to expose
environment:
- NODE_ENV=production
- ADMIN_PASSWORD=password # Change this to a secure password
- DB_PASSWORD=password # Change this to match your postgres password
depends_on:
- db
volumes:
- app-auth:/app/auth
- app-config:/app/config
db:
image: postgres:13
restart: unless-stopped
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password # Change this to a secure password
volumes:
- db-data:/var/lib/postgresql/data
- ./schema.sql:/docker-entrypoint-initdb.d/schema.sql
- ./migrations.sql:/migrations.sql
# Make sure you download the migrations.sql file if you are updating your existing database. If you changed the user or database name, you will need to plug that in in the command below.
command: >
bash -c "
docker-entrypoint.sh postgres &
until pg_isready; do sleep 1; done;
psql -U postgres -d postgres -f /migrations.sql;
wait
"
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
volumes:
db-data:
app-auth:
driver: local
driver_opts:
type: none
o: bind
device: ./auth
app-config:
driver: local
driver_opts:
type: none
o: bind
device: ./config