diff --git a/Dockerfile b/Dockerfile index 5f02e4b..f78deea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,23 +4,14 @@ FROM python:3.11-slim # Set the working directory in the container WORKDIR /app -# Install system dependencies -RUN apt-get update && apt-get install -y \ - gcc \ - && rm -rf /var/lib/apt/lists/* - -# Copy the entire project directory +# Copy the entire project directory (including quartz_solar_forecast) COPY . /app -# Install the project in editable mode +# Install the quartz_solar_forecast package in editable mode RUN pip install -e . -# Install wait-for-it script -ADD https://github.com/vishnubob/wait-for-it/raw/master/wait-for-it.sh /usr/local/bin/wait-for-it -RUN chmod +x /usr/local/bin/wait-for-it - -# Expose ports 8000 (API) and 8501 (Streamlit) to the outside world +# Expose port 8000 and 8501 to the outside world EXPOSE 8000 8501 # The CMD will be provided by docker-compose.yml -CMD ["sh", "-c", "wait-for-it open-meteo-api:8080 -- $CMD"] \ No newline at end of file +CMD ["sh", "-c", "$CMD"] \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index e34a918..2ec209b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -31,15 +31,16 @@ services: container_name: quartz-solar-forecast-api ports: - "8000:8000" + env_file: + - .env volumes: - .:/app - working_dir: /app restart: always environment: <<: *shared_environment command: python api/main.py healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8000/health"] + test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:8000/health')"] interval: 30s timeout: 10s retries: 3 @@ -58,7 +59,7 @@ services: restart: always environment: <<: *shared_environment - FASTAPI_BASE_URL: ${FASTAPI_BASE_URL:-http://web:8000} + FASTAPI_BASE_URL: ${FASTAPI_BASE_URL} command: streamlit run dashboards/dashboard_2/app.py depends_on: web: diff --git a/pyproject.toml b/pyproject.toml index ccd7bb5..2ca908a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] -requires = ["setuptools", "wheel"] -build-backend = "setuptools.build_meta" +requires = ["setuptools", "wheel", "poetry-core>=1.0.8"] +build-backend = ["setuptools.build_meta", "poetry.core.masonry.api"] [project] name = "quartz_solar_forecast"