diff --git a/Dockerfile b/Dockerfile index 74c9a60..9f6aa10 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,7 @@ COPY src ./src # If you have other directories like `templates` or `static`, copy them too # COPY templates ./templates # COPY static ./static -# COPY .env ./.env +COPY .env ./.env # COPY migrations ./migrations # << --- SSH MOUNT ADDED HERE --- >> @@ -62,7 +62,7 @@ COPY --from=builder /usr/src/app/target/release/icarus . # Copy other necessary files like .env (if used for runtime config) or static assets # It's generally better to configure via environment variables in Docker though -# COPY --from=builder /usr/src/app/.env . +COPY --from=builder /usr/src/app/.env . # COPY --from=builder /usr/src/app/migrations ./migrations # COPY --from=builder /usr/src/app/templates ./templates # COPY --from=builder /usr/src/app/static ./static diff --git a/docker-compose.yaml b/docker-compose.yaml index a8446b2..311d60e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -20,7 +20,9 @@ services: # APP_PORT: 3000 depends_on: db: - condition: service_healthy # Wait for the DB to be healthy before starting the app + condition: service_healthy + networks: + - app-network restart: unless-stopped # Optional: Restart policy # --- Web API auth --- @@ -34,10 +36,15 @@ services: - "8001:3000" # Map host port 8000 to container port 8000 (adjust container port based on your app's EXPOSE in Dockerfile) environment: # Environment variables your API needs, e.g., database connection - DATABASE_URL: postgresql://icarus_op:password@postgres:5432/icarus_auth + DATABASE_URL: postgresql://icarus_op:password@auth_db:5432/icarus_auth # Add other necessary environment variables + env_file: + - ../icarus_auth/.env depends_on: - - auth_db # Ensures Postgres starts before the web API attempts to connect + auth_db: + condition: service_healthy + networks: + - app-network # Optional: Mount local code for development (live reload) # volumes: # - ./path/to/your/web-api-repo:/app