Skip to content

Commit 801e5b5

Browse files
committed
add docker-compose
1 parent 741d9cd commit 801e5b5

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docker-compose.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: "3.9"
2+
services:
3+
coder:
4+
image: ghcr.io/coder/coder:v${CODER_VERSION:-0.5.5}-${ARCH:-amd64}
5+
ports:
6+
- "7080:7080"
7+
environment:
8+
CODER_PG_CONNECTION_URL: "postgresql://username:password@database/coder?sslmode=disable"
9+
CODER_ADDRESS: "0.0.0.0:7080"
10+
depends_on:
11+
database:
12+
condition: service_healthy
13+
database:
14+
image: "postgres:14.2"
15+
environment:
16+
POSTGRES_USER: ${POSTGRES_USER:-username} # The PostgreSQL user (useful to connect to the database)
17+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password} # The PostgreSQL password (useful to connect to the database)
18+
POSTGRES_DB: ${POSTGRES_DB:-coder} # The PostgreSQL default database (automatically created at first launch)
19+
volumes:
20+
- pgdata:/var/lib/postgresql/data # Use "docker volume rm coder_pgdata" to reset Coder
21+
healthcheck:
22+
test:
23+
[
24+
"CMD-SHELL",
25+
"pg_isready -U ${POSTGRES_USER:-username} -d ${POSTGRES_DB:-coder}",
26+
]
27+
interval: 5s
28+
timeout: 5s
29+
retries: 5
30+
volumes:
31+
pgdata:

0 commit comments

Comments
 (0)