-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.yml
83 lines (78 loc) · 2.1 KB
/
test.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
version: '3.8'
services:
db:
image: postgres:16.2
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpassword
POSTGRES_DB: test
ports:
- "5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U testuser -d test" ]
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: backend
dockerfile: test.Dockerfile
working_dir: /backend/app
hostname: backend
# ports:
# - "8000:8000"
# volumes:
# - ./src/backend:/backend
command: bash -c "uvicorn main:app --host 0.0.0.0 --port 8000 --reload"
environment:
PYTHONUNBUFFERED: 1
DATABASE_URL: postgresql://testuser:testpassword@db:5432/test
REDIS_URL: redis://redis:6379/0
ALGORITHM: "HS256"
SECRET_KEY: "1<3TwoTestThings!123456789"
depends_on:
- db
labels:
- "traefik.enable=true"
- "traefik.http.routers.backend.rule=Host(`localhost`) && PathPrefix(`/api`)"
- "traefik.http.services.backend.loadbalancer.server.port=8000"
- "traefik.http.services.backend.loadbalancer.sticky.cookie=true"
- "traefik.http.services.backend.loadbalancer.sticky.cookie.name=backend_cookie"
frontend:
build:
context: frontend
dockerfile: test.Dockerfile
args:
REACT_APP_API_URL: http://localhost
hostname: frontend
# ports:
# - "3000:3000"
depends_on:
- backend
links:
- backend
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.rule=Host(`localhost`)"
- "traefik.http.services.frontend.loadbalancer.server.port=3000"
redis:
container_name: redis
image: "redis:alpine"
ports:
- "6379:6379"
traefik:
image: traefik:latest
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
volumes:
postgres_data: