mirror of
https://github.com/arthur-pbty/LazyBot.git
synced 2026-06-03 15:07:29 +02:00
refactor: migrate from SQLite to PostgreSQL for session management and data storage
- Updated package dependencies to replace SQLite with PostgreSQL. - Modified privacy policy to reflect the change in database technology. - Adjusted session management in server.js to use connect-pg-simple. - Enhanced docker-compose.yml to include PostgreSQL service with health checks. - Added Dockerfile for multi-stage builds for development and production environments. - Introduced .dockerignore to exclude unnecessary files from the Docker context.
This commit is contained in:
+23
-9
@@ -1,13 +1,27 @@
|
||||
services:
|
||||
web:
|
||||
image: node:20
|
||||
container_name: discord_bot_web
|
||||
working_dir: /app
|
||||
volumes:
|
||||
- ./app:/app
|
||||
ports:
|
||||
- "${PORT}:${PORT}"
|
||||
build: .
|
||||
image: lazybot:latest
|
||||
env_file:
|
||||
- ./.env
|
||||
command: sh -c "npm install && node server.js"
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${PORT:-3000}:${PORT:-3000}"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
env_file:
|
||||
- ./.env
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-lazybot} -d ${POSTGRES_DB:-lazybot}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
volumes:
|
||||
- ${POSTGRES_DATA_PATH:-./data/postgres}:/var/lib/postgresql/data
|
||||
restart: unless-stopped
|
||||
|
||||
volumes: {}
|
||||
Reference in New Issue
Block a user