mirror of
https://github.com/coder/coder.git
synced 2026-06-06 22:48:19 +00:00
75dc8f59f6
* fix: example: update docker-local to use host-gateway * docker-compose.yaml: Add POSTGRES_ environment variables to CODER_PG_CONNECTION_URL Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
34 lines
1.2 KiB
YAML
34 lines
1.2 KiB
YAML
version: "3.9"
|
|
services:
|
|
coder:
|
|
image: ghcr.io/coder/coder:v${CODER_VERSION:-0.5.6}-${ARCH:-amd64}
|
|
ports:
|
|
- "7080:7080"
|
|
environment:
|
|
CODER_PG_CONNECTION_URL: "postgresql://${POSTGRES_USER:-username}:${POSTGRES_PASSWORD:-password}@database/${POSTGRES_DB:-coder}?sslmode=disable"
|
|
CODER_ADDRESS: "0.0.0.0:7080"
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
depends_on:
|
|
database:
|
|
condition: service_healthy
|
|
database:
|
|
image: "postgres:14.2"
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-username} # The PostgreSQL user (useful to connect to the database)
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password} # The PostgreSQL password (useful to connect to the database)
|
|
POSTGRES_DB: ${POSTGRES_DB:-coder} # The PostgreSQL default database (automatically created at first launch)
|
|
volumes:
|
|
- coder_data:/var/lib/postgresql/data # Use "docker volume rm coder_coder_data" to reset Coder
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD-SHELL",
|
|
"pg_isready -U ${POSTGRES_USER:-username} -d ${POSTGRES_DB:-coder}",
|
|
]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
volumes:
|
|
coder_data:
|