This commit is contained in:
2026-08-22 19:36:03 +02:00
parent 4e3c5b641e
commit ed33fbb230
3 changed files with 14 additions and 8 deletions
+5 -5
View File
@@ -1,9 +1,9 @@
# ── SQLite (default for local dev) ──
DB_DRIVER=sqlite
SQLITE_PATH=./data/surprise.db
# ── Postgres (default) ──
DB_DRIVER=postgres
DATABASE_URL=postgres://surprise:surprise_dev_password@localhost:5432/surprise?sslmode=disable
# ── Postgres (uncomment and set DB_DRIVER=postgres to use) ──
# DATABASE_URL=postgres://surprise:surprise_dev_password@localhost:5432/surprise?sslmode=disable
# ── SQLite (set DB_DRIVER=sqlite to use) ──
# SQLITE_PATH=./data/surprise.db
PORT=8080
CORS_ORIGIN=http://localhost:5173,http://127.0.0.1:5173
+3 -3
View File
@@ -33,10 +33,10 @@ func Load() Config {
}
return Config{
DBDriver: envOrDefault("DB_DRIVER", "sqlite"),
DBDriver: envOrDefault("DB_DRIVER", "postgres"),
Port: envOrDefault("PORT", "8080"),
DatabaseURL: envOrDefault("DATABASE_URL", ""),
SQLitePath: envOrDefault("SQLITE_PATH", ""),
DatabaseURL: envOrDefault("DATABASE_URL", "postgres://surprise:surprise_dev_password@localhost:5432/surprise?sslmode=disable"),
SQLitePath: envOrDefault("SQLITE_PATH", "./data/surprise.db"),
CORSOrigin: envOrDefault("CORS_ORIGIN", "http://localhost:5173,http://127.0.0.1:5173"),
SessionSecret: envOrDefault("SESSION_SECRET", "local-development-session-secret-change-me"),
CookieSecure: parseBoolEnv("COOKIE_SECURE", false),
+6
View File
@@ -1,6 +1,7 @@
services:
postgres:
image: postgres:16-alpine
container_name: sndit-postgres
restart: unless-stopped
environment:
POSTGRES_DB: surprise
@@ -19,6 +20,7 @@ services:
minio:
image: minio/minio:latest
container_name: sndit-minio
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
@@ -38,6 +40,7 @@ services:
api:
build: ./backend
container_name: sndit-api
restart: unless-stopped
ports:
- "${PORT:-8080}:8080"
@@ -62,6 +65,7 @@ services:
migrate:
build: ./backend
container_name: sndit-migrate
command: ["migrate", "-dir", "/migrations"]
environment:
DB_DRIVER: postgres
@@ -74,6 +78,7 @@ services:
seed:
build: ./backend
container_name: sndit-seed
command: ["seed"]
environment:
DB_DRIVER: postgres
@@ -87,6 +92,7 @@ services:
context: ./frontend
args:
VITE_API_BASE_URL: ""
container_name: sndit-frontend
restart: unless-stopped
ports:
- "${FRONTEND_PORT:-8081}:80"