-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker-compose.yml
79 lines (74 loc) · 1.94 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
version: "3"
x-base-app-conf: &base_app_conf
env_file: .env
stdin_open: true
tty: true
services:
myproject:
<<: *base_app_conf
image: myproject:latest
container_name: myproject
restart: always
build:
context: .
dockerfile: docker/Dockerfile
ports:
- "8000:8000"
volumes:
- "./app:/src/app"
depends_on:
- db
- django-migrations
# Apply Django migrations
django-migrations:
<<: *base_app_conf
image: myproject:latest
container_name: django-migrations
command: python manage.py migrate
restart: no
build:
context: .
dockerfile: docker/Dockerfile
volumes:
- "./app:/src/app"
depends_on:
- db
# Generating CSS output file for Tailwind CSS on save
npm-watch:
<<: *base_app_conf
image: myproject:latest
container_name: npm-watch
working_dir: /src
command: npm run watch:tailwindcss
restart: always
volumes:
- "./app:/src/app"
depends_on:
- myproject
# Copying JS file from htmx package
htmx-js-generator:
<<: *base_app_conf
image: myproject:latest
container_name: htmx-js-generator
working_dir: /src
command: npm run build:htmx
restart: no
volumes:
- "./app:/src/app"
depends_on:
- myproject
db:
image: postgres:16.0-alpine
command: ["postgres", "-c", "log_statement=all", "-c", "log_destination=stderr"]
container_name: db
restart: always
environment:
- POSTGRES_DB=mydatabase
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- "5432:5432"
volumes:
- db:/var/lib/postgresql/data
volumes:
db: