39 lines
981 B
YAML
39 lines
981 B
YAML
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
container_name: webstore_db
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: webstore_db
|
|
POSTGRES_USER: webstore_user
|
|
POSTGRES_PASSWORD: webstore_password
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: webstore_api
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- db
|
|
environment:
|
|
PORT: 3000
|
|
NODE_ENV: development
|
|
DATABASE_URL: postgresql://webstore_user:webstore_password@db:5432/webstore_db?schema=public
|
|
JWT_SECRET: dev-secret-change-me
|
|
JWT_EXPIRES_IN: 7d
|
|
COOKIE_NAME: webstore_token
|
|
COOKIE_SECURE: "false"
|
|
ports:
|
|
- "3000:3000"
|
|
volumes:
|
|
- .:/app
|
|
- /app/node_modules
|
|
command: sh -c "npm run prisma:generate && npm run prisma:push && npm run prisma:seed && npm run dev"
|
|
|
|
volumes:
|
|
postgres_data: |