44 lines
1.0 KiB
Plaintext
44 lines
1.0 KiB
Plaintext
services:
|
|
db:
|
|
image: postgres:15
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: components_elixir_prod
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
app:
|
|
build: .
|
|
ports:
|
|
- "4000:4000"
|
|
environment:
|
|
DATABASE_URL: "ecto://postgres:postgres@db:5432/components_elixir_prod"
|
|
SECRET_KEY_BASE: "your-secret-key-here" # Generate with: mix phx.gen.secret
|
|
PHX_HOST: "localhost"
|
|
PHX_SERVER: "true"
|
|
PORT: "4000"
|
|
UPLOADS_DIR: "/data/uploads"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
volumes:
|
|
- uploaded_files:/data/uploads
|
|
command:
|
|
[
|
|
"/bin/sh",
|
|
"-c",
|
|
"/app/bin/components_elixir eval 'ComponentsElixir.Release.migrate' && /app/bin/components_elixir start",
|
|
]
|
|
|
|
volumes:
|
|
postgres_data:
|
|
uploaded_files:
|