-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
101 lines (95 loc) · 2.61 KB
/
docker-compose.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
version: '3.8'
services:
server:
image: "rancher/k3s:${K3S_VERSION:-latest}"
# --tls-san server adds name "server" to TLS cert so the cert validates
# when accessing the API via the docker name like https://server:6443
command: server --tls-san server --https-listen-port ${K8S_PORT:-6443}
tmpfs:
- /run
- /var/run
ulimits:
nproc: 65535
nofile:
soft: 65535
hard: 65535
privileged: true
restart: always
environment:
- K3S_TOKEN=secret
- K3S_KUBECONFIG_OUTPUT=/output/kubeconfig.yaml
- K3S_KUBECONFIG_MODE=666
volumes:
# This is just so that we get the kubeconfig file out
- .:/output
ports:
- ${K8S_PORT:-6443}:${K8S_PORT:-6443} # Kubernetes API Server
agent:
image: "rancher/k3s:${K3S_VERSION:-latest}"
tmpfs:
- /run
- /var/run
ulimits:
nproc: 65535
nofile:
soft: 65535
hard: 65535
privileged: true
restart: always
environment:
- K3S_URL=https://server:${K8S_PORT:-6443}
- K3S_TOKEN=secret
cluster-setup:
image: alpine/k8s:1.27.3
depends_on:
- server
- agent
restart: "no"
volumes:
- .:/opt/swoop-go
environment:
- ARGO_VERSION=latest
- KUBECONFIG=/opt/swoop-go/kubeconfig.yaml
- SERVER_URL=https://server:${K8S_PORT:-6443}
entrypoint: [ "sh", "/opt/swoop-go/bin/setup-cluster.sh" ]
postgres:
image: quay.io/element84/swoop-db:latest
restart: always
environment:
POSTGRES_DB: "${PGDATABASE:-swoop}"
POSTGRES_PASSWORD: "${PGPASSWORD:-password}"
POSTGRES_USER: "${PGUSER:-postgres}"
ports:
- "${PGPORT:-5432}:5432"
db-setup:
image: quay.io/element84/swoop-db:latest
depends_on:
- postgres
restart: "no"
environment:
- PGHOST=postgres
- PGDATABASE=${PGDATABASE:-swoop}
- PGUSER=${PGUSER:-postgres}
- PGPASSWORD=${PGPASSWORD:-password}
entrypoint:
- "sh"
- "-c"
- |
for i in $$(seq 15); do
sleep 2
swoop-db up && {
echo "SUCCESS: swoop-db applied migrations"
swoop-db load-fixture base_01
break
}
done
minio:
image: quay.io/minio/minio
ports:
- "9010:9000"
- "9011:9001"
environment:
MINIO_ROOT_USER: "${MINIO_ACCESS_KEY:-minio}"
MINIO_ROOT_PASSWORD: "${MINIO_SECRET_KEY:-password}"
SWOOP_BUCKET_NAME: "${SWOOP_S3_BUCKET:-swoop}"
entrypoint: bash -c 'mkdir -p "$${1}/$${SWOOP_BUCKET_NAME}" && exec minio server --console-address ":9001" "$${1}"' -- "/tmp/minio"