Add postgres to devcontainer / compose

This commit is contained in:
Willem van den Ende
2026-03-18 11:22:54 +00:00
parent 2d97353649
commit 7c3aac56ec
5 changed files with 45 additions and 6 deletions
+7 -4
View File
@@ -1,10 +1,13 @@
{
"$schema": "https://containers.dev/implementors/json_schema/",
"build": {
"dockerfile": "Dockerfile"
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/firehose",
"remoteUser": "root",
"containerEnv": {
"DB_HOST": "db",
"HOME": "/home/vscode"
},
"remoteUser": "vscode",
"runArgs": [],
"features": {
"ghcr.io/devcontainers/features/python:1": {},
"ghcr.io/jsburckhardt/devcontainer-features/uv:1": {},
+28
View File
@@ -0,0 +1,28 @@
services:
app:
build:
context: .
dockerfile: Dockerfile
volumes:
- ..:/workspaces/firehose:cached
command: sleep infinity
depends_on:
db:
condition: service_healthy
db:
image: postgres:16
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
volumes:
pgdata: