-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
105 lines (99 loc) · 2.9 KB
/
docker-compose.yml
File metadata and controls
105 lines (99 loc) · 2.9 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
93
94
95
96
97
98
99
100
101
102
103
104
105
# Production docker-compose for self-hosting Gitbacker.
#
# Usage:
# cp .env.example .env # fill in your secrets
# docker compose up -d
#
# Pin a specific release:
# VERSION=1.2.3 docker compose up -d
networks:
# Backend: Postgres + Redis + the services that access them.
# Not exposed to other compose projects.
backend:
driver: bridge
# Frontend-facing: only api and frontend need to talk.
web:
driver: bridge
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-gitbacker}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-gitbacker}
POSTGRES_DB: ${POSTGRES_DB:-gitbacker}
volumes:
- ./data/postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-gitbacker}"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- backend
redis:
image: redis:7-alpine
volumes:
- ./data/redis:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- backend
api:
image: ghcr.io/gitbckr/gitbacker-api:${VERSION:-latest}
platform: linux/amd64
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-gitbacker}:${POSTGRES_PASSWORD:-gitbacker}@postgres:5432/${POSTGRES_DB:-gitbacker}
REDIS_URL: redis://redis:6379/0
JWT_SECRET: ${JWT_SECRET:?Set JWT_SECRET in .env}
JWT_ALGORITHM: ${JWT_ALGORITHM:-HS256}
ACCESS_TOKEN_EXPIRE_MINUTES: ${ACCESS_TOKEN_EXPIRE_MINUTES:-30}
ENVIRONMENT: production
volumes:
- ${BACKUP_DIR:-./data/backups}:/data/backups
ports:
- "${API_PORT:-8000}:8000"
restart: unless-stopped
networks:
- backend
- web
worker:
image: ghcr.io/gitbckr/gitbacker-worker:${VERSION:-latest}
platform: linux/amd64
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
DATABASE_URL: postgresql+psycopg2://${POSTGRES_USER:-gitbacker}:${POSTGRES_PASSWORD:-gitbacker}@postgres:5432/${POSTGRES_DB:-gitbacker}
REDIS_URL: redis://redis:6379/0
# Must match the api service — same secret derives the Fernet key used
# to encrypt/decrypt credentials in the DB.
JWT_SECRET: ${JWT_SECRET:?Set JWT_SECRET in .env}
volumes:
- ${BACKUP_DIR:-./data/backups}:/data/backups
restart: unless-stopped
networks:
- backend
frontend:
image: ghcr.io/gitbckr/gitbacker-frontend:${VERSION:-latest}
platform: linux/amd64
depends_on:
- api
environment:
INTERNAL_API_URL: http://api:8000
ports:
- "${FRONTEND_PORT:-3000}:3000"
restart: unless-stopped
networks:
- web