From 0ab2e5ba2b0631b28b5b1405559237b3913c878f Mon Sep 17 00:00:00 2001 From: Dawid Rycerz Date: Sun, 23 Mar 2025 17:11:39 +0100 Subject: feat: initialize Phoenix application for weather alerts This commit sets up the initial Silmataivas project structure, including: Phoenix web framework configuration, database models for users and locations, weather polling service, notification system, Docker and deployment configurations, CI/CD pipeline setup --- installation/docker-compose.deploy.yml | 67 ++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 installation/docker-compose.deploy.yml (limited to 'installation/docker-compose.deploy.yml') 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 -- cgit v1.2.3