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) ── # ── Postgres (default) ──
DB_DRIVER=sqlite DB_DRIVER=postgres
SQLITE_PATH=./data/surprise.db DATABASE_URL=postgres://surprise:surprise_dev_password@localhost:5432/surprise?sslmode=disable
# ── Postgres (uncomment and set DB_DRIVER=postgres to use) ── # ── SQLite (set DB_DRIVER=sqlite to use) ──
# DATABASE_URL=postgres://surprise:surprise_dev_password@localhost:5432/surprise?sslmode=disable # SQLITE_PATH=./data/surprise.db
PORT=8080 PORT=8080
CORS_ORIGIN=http://localhost:5173,http://127.0.0.1:5173 CORS_ORIGIN=http://localhost:5173,http://127.0.0.1:5173
+3 -3
View File
@@ -33,10 +33,10 @@ func Load() Config {
} }
return Config{ return Config{
DBDriver: envOrDefault("DB_DRIVER", "sqlite"), DBDriver: envOrDefault("DB_DRIVER", "postgres"),
Port: envOrDefault("PORT", "8080"), Port: envOrDefault("PORT", "8080"),
DatabaseURL: envOrDefault("DATABASE_URL", ""), DatabaseURL: envOrDefault("DATABASE_URL", "postgres://surprise:surprise_dev_password@localhost:5432/surprise?sslmode=disable"),
SQLitePath: envOrDefault("SQLITE_PATH", ""), SQLitePath: envOrDefault("SQLITE_PATH", "./data/surprise.db"),
CORSOrigin: envOrDefault("CORS_ORIGIN", "http://localhost:5173,http://127.0.0.1:5173"), CORSOrigin: envOrDefault("CORS_ORIGIN", "http://localhost:5173,http://127.0.0.1:5173"),
SessionSecret: envOrDefault("SESSION_SECRET", "local-development-session-secret-change-me"), SessionSecret: envOrDefault("SESSION_SECRET", "local-development-session-secret-change-me"),
CookieSecure: parseBoolEnv("COOKIE_SECURE", false), CookieSecure: parseBoolEnv("COOKIE_SECURE", false),
+6
View File
@@ -1,6 +1,7 @@
services: services:
postgres: postgres:
image: postgres:16-alpine image: postgres:16-alpine
container_name: sndit-postgres
restart: unless-stopped restart: unless-stopped
environment: environment:
POSTGRES_DB: surprise POSTGRES_DB: surprise
@@ -19,6 +20,7 @@ services:
minio: minio:
image: minio/minio:latest image: minio/minio:latest
container_name: sndit-minio
restart: unless-stopped restart: unless-stopped
command: server /data --console-address ":9001" command: server /data --console-address ":9001"
environment: environment:
@@ -38,6 +40,7 @@ services:
api: api:
build: ./backend build: ./backend
container_name: sndit-api
restart: unless-stopped restart: unless-stopped
ports: ports:
- "${PORT:-8080}:8080" - "${PORT:-8080}:8080"
@@ -62,6 +65,7 @@ services:
migrate: migrate:
build: ./backend build: ./backend
container_name: sndit-migrate
command: ["migrate", "-dir", "/migrations"] command: ["migrate", "-dir", "/migrations"]
environment: environment:
DB_DRIVER: postgres DB_DRIVER: postgres
@@ -74,6 +78,7 @@ services:
seed: seed:
build: ./backend build: ./backend
container_name: sndit-seed
command: ["seed"] command: ["seed"]
environment: environment:
DB_DRIVER: postgres DB_DRIVER: postgres
@@ -87,6 +92,7 @@ services:
context: ./frontend context: ./frontend
args: args:
VITE_API_BASE_URL: "" VITE_API_BASE_URL: ""
container_name: sndit-frontend
restart: unless-stopped restart: unless-stopped
ports: ports:
- "${FRONTEND_PORT:-8081}:80" - "${FRONTEND_PORT:-8081}:80"