1.2 KiB
1.2 KiB
Docker Guide
Docker Compose
# Start services
docker-compose up -d
# Setup database
docker-compose exec app bun run db:push
# View logs
docker-compose logs -f app
# Stop services
docker-compose down
Visit http://localhost:3000
Docker Build
# Build image
docker build -t wishlist-app .
# Run container
docker run -d \
-p 3000:3000 \
-e DATABASE_URL="postgresql://user:pass@host:5432/db" \
--name wishlist-app \
wishlist-app
Environment Variables
Required:
DATABASE_URL- PostgreSQL connection stringNODE_ENV- Set toproductionPORT- Default3000
Optional (Docker Compose):
POSTGRES_USER- Database user (default:wishlistuser)POSTGRES_PASSWORD- Database password (default:wishlistpassword)POSTGRES_DB- Database name (default:wishlist)POSTGRES_DATA_PATH- Custom path for PostgreSQL data- Example:
/mnt/storage/wishlist/postgres - Must be an absolute path
- Directory must exist with proper permissions
- Example:
Database Setup
# docker-compose
docker-compose exec app bun run db:push
# Standalone container
docker exec -it wishlist-app bun run db:push
Migrations
Production migrations:
docker exec -it wishlist-app bun run db:migrate