Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
aryanbhosale committed Sep 14, 2024
1 parent b0bb165 commit f053d0c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
17 changes: 4 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
CMD ["sh", "-c", "$CMD"]
7 changes: 4 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit f053d0c

Please sign in to comment.