-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
47 lines (44 loc) · 1.15 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
services:
next:
container_name: next
image: chetanb1029/publicbets-nextjs:latest
platform: linux/amd64
depends_on:
- db
environment:
- DATABASE_URL=${DATABASE_URL}
# if you are using reverse proxy you dont need to expose the port
ports:
- "3000:3000"
db:
image: postgres:15
container_name: database
restart: always
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USER}
POSTGRES_DB: ${DB_NAME}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 1s
timeout: 3s
retries: 30
volumes:
- postgres_data:/var/lib/postgresql/data
# you dont need to expose the port, use it if you want to connect to databse from your local machine while developing
ports:
- "5432:5432"
cron:
container_name: cronjob
image: alpine:3.14
restart: always
volumes:
- ./cronjob:/etc/crontabs/root # Copy your cronjob file into the container
depends_on:
- next
entrypoint: >
sh -c "
apk add --no-cache curl &&
crond -f -l 2"
volumes:
postgres_data: