summaryrefslogtreecommitdiff
path: root/installation/docker-compose.deploy.yml
diff options
context:
space:
mode:
Diffstat (limited to 'installation/docker-compose.deploy.yml')
-rw-r--r--installation/docker-compose.deploy.yml67
1 files changed, 67 insertions, 0 deletions
diff --git a/installation/docker-compose.deploy.yml b/installation/docker-compose.deploy.yml
new file mode 100644
index 0000000..125db4b
--- /dev/null
+++ b/installation/docker-compose.deploy.yml
@@ -0,0 +1,67 @@
+services:
+ # Silmataivas application
+ app:
+ image: ${DOCKER_IMAGE}
+ restart: unless-stopped
+ ports:
+ - "4000:4000"
+ environment:
+ - PHX_HOST=${PHX_HOST:-localhost}
+ - SECRET_KEY_BASE=${SECRET_KEY_BASE}
+ - DB_ADAPTER=${DB_ADAPTER:-sqlite}
+ - DATABASE_URL=${DATABASE_URL:-/app/data/silmataivas.db}
+ - OPENWEATHERMAP_API_KEY=${OPENWEATHERMAP_API_KEY}
+ - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-}
+ - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-}
+ volumes:
+ - silmataivas_data:/app/data
+ # Command to run on container start - will run database migrations before starting the application
+ command: sh -c "/app/bin/silmataivas eval 'Silmataivas.Release.setup()' && /app/bin/silmataivas start"
+ networks:
+ - silmataivas_network
+ # Uncomment the following lines if using PostgreSQL
+ # depends_on:
+ # db:
+ # condition: service_started
+ # required: false
+ healthcheck:
+ test: ["CMD", "curl", "-f", "http://localhost:4000/health"]
+ interval: 30s
+ timeout: 5s
+ retries: 3
+ start_period: 10s
+
+ # PostgreSQL database
+ # To enable PostgreSQL:
+ # 1. Uncomment this section
+ # 2. Set DB_ADAPTER=postgres in your environment
+ # 3. Set DATABASE_URL to your PostgreSQL connection string
+ #db:
+ # image: postgres:16-alpine
+ # restart: unless-stopped
+ # ports:
+ # - "5432:5432"
+ # environment:
+ # - POSTGRES_USER=${PGUSER:-postgres}
+ # - POSTGRES_PASSWORD=${PGPASSWORD:-postgres}
+ # - POSTGRES_DB=${PGDATABASE:-silmataivas_prod}
+ # volumes:
+ # - postgres_data:/var/lib/postgresql/data
+ # networks:
+ # - silmataivas_network
+ # # Only start PostgreSQL if DB_ADAPTER is set to postgres
+ # profiles:
+ # - postgres
+ # healthcheck:
+ # test: ["CMD-SHELL", "pg_isready -U postgres"]
+ # interval: 10s
+ # timeout: 5s
+ # retries: 5
+
+volumes:
+ silmataivas_data:
+ # postgres_data:
+
+networks:
+ silmataivas_network:
+ driver: bridge