-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
92 lines (86 loc) · 2.3 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
92 lines (86 loc) · 2.3 KB
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
84
85
86
87
88
89
90
91
92
---
#
# This dockerfile eases development:
#
# Create a .env file with the current user's UID and GID:
# echo -e "UID=$(id -u)\nGID=$(id -g)" > .env
#
# Development environment:
# docker-compose up -d dev
#
# Local API testing environment:
# docker-compose up -d api-data-tls
# open https://localhost/ui/
#
# Spin latest built images from GitHub Container Registry:
# docker-compose up -d api-data-public-tls
#
services:
dev:
build:
context: .
target: dev
user: "${UID:-1000}:${GID:-1000}"
working_dir: /code
volumes:
- .:/code
test:
build:
context: .
target: test
user: "${UID:-1000}:${GID:-1000}"
api-data: &api
build:
context: .
dockerfile: apiv1/Dockerfile
target: data-api
user: "${UID:-1000}:${GID:-1000}"
restart: no
environment:
# App configuration.
- HARVEST_DB=https://raw.githubusercontent.com/teamdigitale/dati-semantic-harvest/refs/heads/harvest/vocabularies.db
- API_BASE_URL=https://localhost
- PREDECESSOR_BASE_URL=https://schema.gov.it/api/vocabularies
- CORS_ORIGINS=*
# Set to true to enable the Swagger UI (disabled by default).
- SWAGGER_UI=true
# Uvicorn configuration.
- UVICORN_WORKERS=4
- UVICORN_LOG_LEVEL=debug
# Trust X-Forwarded-Proto from the Caddy reverse proxy so that 307 redirects
# return https:// Location headers instead of http://.
- UVICORN_FORWARDED_ALLOW_IPS=*
ports:
- "8001:8080"
# Allow for downloading the harvest database and for testing the API from the host machine.
working_dir: /tmp
volumes:
- ./apiv1/tests/data/:/data:ro
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/status"]
interval: 1m30s
timeout: 30s
retries: 5
start_period: 30s
api-data-tls: &tls
image: docker.io/caddy:2
ports:
- "443:443"
volumes:
- ./tests/data/Caddyfile.api-data:/etc/caddy/Caddyfile:ro
- caddy_deleteme:/data
depends_on:
- api-data
api-data-public:
<<: *api
build: {}
image: ghcr.io/teamdigitale/dati-semantic-csv-apis-data:latest
api-data-public-tls:
<<: *tls
volumes:
- ./tests/data/Caddyfile.api-data-public:/etc/caddy/Caddyfile:ro
- caddy_deleteme:/data
depends_on:
- api-data-public
volumes:
caddy_deleteme: