Added Docker file #117

Merged
kdeng00 merged 16 commits from add_docker into v0.2 2025-04-13 14:53:05 -04:00
2 changed files with 12 additions and 5 deletions
Showing only changes of commit 194d86d168 - Show all commits
+2 -2
View File
@@ -36,7 +36,7 @@ COPY src ./src
# If you have other directories like `templates` or `static`, copy them too # If you have other directories like `templates` or `static`, copy them too
# COPY templates ./templates # COPY templates ./templates
# COPY static ./static # COPY static ./static
# COPY .env ./.env COPY .env ./.env
# COPY migrations ./migrations # COPY migrations ./migrations
# << --- SSH MOUNT ADDED HERE --- >> # << --- 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 # 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 # 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/migrations ./migrations
# COPY --from=builder /usr/src/app/templates ./templates # COPY --from=builder /usr/src/app/templates ./templates
# COPY --from=builder /usr/src/app/static ./static # COPY --from=builder /usr/src/app/static ./static
+10 -3
View File
@@ -20,7 +20,9 @@ services:
# APP_PORT: 3000 # APP_PORT: 3000
depends_on: depends_on:
db: 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 restart: unless-stopped # Optional: Restart policy
# --- Web API auth --- # --- 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) - "8001:3000" # Map host port 8000 to container port 8000 (adjust container port based on your app's EXPOSE in Dockerfile)
environment: environment:
# Environment variables your API needs, e.g., database connection # 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 # Add other necessary environment variables
env_file:
- ../icarus_auth/.env
depends_on: 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) # Optional: Mount local code for development (live reload)
# volumes: # volumes:
# - ./path/to/your/web-api-repo:/app # - ./path/to/your/web-api-repo:/app