-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
64 lines (64 loc) · 1.51 KB
/
docker-compose.yaml
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
services:
server:
environment:
HOTELS_DATABASE_HOST: db
HOTELS_DATABASE_PORT: 5433
build:
context: .
dockerfile: deploy/server.Dockerfile
ports:
- "8000:8000"
command: ["gunicorn", "hotels.wsgi:application", "--name", "hotels", "--bind", "0.0.0.0:8000"]
extra_hosts:
- "host.docker.internal:host-gateway"
restart: always
depends_on:
- db
migrations:
environment:
HOTELS_DATABASE_HOST: db
HOTELS_DATABASE_PORT: 5433
build:
context: .
dockerfile: deploy/server.Dockerfile
command: ["python3.13", "./manage.py", "migrate", "hotels"]
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
- db
tests:
environment:
HOTELS_DATABASE_HOST: db
HOTELS_DATABASE_PORT: 5433
build:
context: .
dockerfile: deploy/server.Dockerfile
command: ["pytest"]
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
- db
fill_db:
environment:
HOTELS_DATABASE_HOST: db
HOTELS_DATABASE_PORT: 5433
build:
context: .
dockerfile: deploy/server.Dockerfile
command: ["python3.13", "manage.py", "scrape_hotels"]
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
- db
- migrations
db:
image: postgres:latest
environment:
POSTGRES_PASSWORD: qwerty
POSTGRES_USER: hotels_user
POSTGRES_DB: hotels
expose:
- "5433"
ports:
- "5433:5433"
command: -p 5433