Skip to content

Commit 62fcda8

Browse files
committed
chore: add docker-compose configuration for Zitadel services and update .gitignore
- Introduced a new docker-compose.yml file to define services for Zitadel, including a PostgreSQL database and Mailhog for testing. - Updated .gitignore to exclude the machinekey directory.
1 parent a2770d9 commit 62fcda8

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ public/dist
1616
/blob-report/
1717
/out
1818
/docker
19+
/machinekey

docker-compose.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
services:
2+
zitadel:
3+
# The user should have the permission to write to ./machinekey
4+
user: "${UID:-1000}"
5+
restart: 'always'
6+
networks:
7+
- 'zitadel'
8+
image: 'ghcr.io/zitadel/zitadel:v3.3.0'
9+
command: 'start-from-init --masterkey "MasterkeyNeedsToHave32Characters" --tlsMode disabled'
10+
environment:
11+
ZITADEL_DATABASE_POSTGRES_HOST: db
12+
ZITADEL_DATABASE_POSTGRES_PORT: 5432
13+
ZITADEL_DATABASE_POSTGRES_DATABASE: zitadel
14+
ZITADEL_DATABASE_POSTGRES_USER_USERNAME: zitadel
15+
ZITADEL_DATABASE_POSTGRES_USER_PASSWORD: zitadel
16+
ZITADEL_DATABASE_POSTGRES_USER_SSL_MODE: disable
17+
ZITADEL_DATABASE_POSTGRES_ADMIN_USERNAME: postgres
18+
ZITADEL_DATABASE_POSTGRES_ADMIN_PASSWORD: postgres
19+
ZITADEL_DATABASE_POSTGRES_ADMIN_SSL_MODE: disable
20+
ZITADEL_EXTERNALSECURE: false
21+
ZITADEL_FIRSTINSTANCE_MACHINEKEYPATH: /machinekey/zitadel-admin-sa.json
22+
ZITADEL_FIRSTINSTANCE_ORG_MACHINE_MACHINE_USERNAME: zitadel-admin-sa
23+
ZITADEL_FIRSTINSTANCE_ORG_MACHINE_MACHINE_NAME: Admin
24+
ZITADEL_FIRSTINSTANCE_ORG_MACHINE_MACHINEKEY_TYPE: 1
25+
depends_on:
26+
db:
27+
condition: 'service_healthy'
28+
ports:
29+
- '8080:8080'
30+
volumes:
31+
- ./machinekey:/machinekey
32+
33+
db:
34+
restart: 'always'
35+
image: postgres:17-alpine
36+
environment:
37+
PGUSER: postgres
38+
POSTGRES_PASSWORD: postgres
39+
networks:
40+
- 'zitadel'
41+
healthcheck:
42+
test: ["CMD-SHELL", "pg_isready", "-d", "zitadel", "-U", "postgres"]
43+
interval: '10s'
44+
timeout: '30s'
45+
retries: 5
46+
start_period: '20s'
47+
48+
mailhog: # Mailhog is a fake local SMTP server for testing
49+
image: mailhog/mailhog:latest
50+
ports:
51+
- '1025:1025'
52+
- '8025:8025' # Web UI
53+
networks:
54+
- 'zitadel'
55+
56+
networks:
57+
zitadel:

0 commit comments

Comments
 (0)