- Rename project from 'bookmann' to 'shelf' - Move all backend/ contents to root level (flatten structure) - Update Go module name from 'bookmann' to 'shelf' - Update all import paths to use new 'shelf' module - Update Dockerfile to work without backend/ subdirectory - Update docker-compose.yml to use new structure and rename containers - Update .gitignore for new file paths - Update README.md with new project name and structure - Regenerate database code with new module imports
53 lines
1.1 KiB
YAML
53 lines
1.1 KiB
YAML
version: "3.8"
|
|
|
|
services:
|
|
db:
|
|
image: postgres:15-alpine
|
|
container_name: shelf_db
|
|
environment:
|
|
POSTGRES_DB: ebookdb
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: ${DBPASS}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./migrations:/docker-entrypoint-initdb.d
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
env_file:
|
|
- .env
|
|
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: ./Dockerfile
|
|
container_name: shelf
|
|
environment:
|
|
DATABASE_HOST: db
|
|
DATABASE_PORT: 5432
|
|
DATABASE_USER: postgres
|
|
DATABASE_PASSWORD: ${DBPASS}
|
|
DATABASE_NAME: ebookdb
|
|
JWT_SECRET: ${JWT_SECRET}
|
|
SERVER_PORT: 8765
|
|
ports:
|
|
- "8765:8765"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./uploads:/app/uploads
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8765/"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
env_file:
|
|
- .env
|
|
|
|
volumes:
|
|
postgres_data: |