-
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dockerise * Update docker-compose.yaml * Create Dockerfile
- Loading branch information
1 parent
e430ed5
commit 5f2f64c
Showing
3 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Use an official Python runtime as a parent image | ||
FROM python:3.11-slim | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy the requirements.txt file | ||
COPY requirements.txt . | ||
|
||
# Install any needed packages specified in requirements.txt | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the entire project directory (including quartz_solar_forecast) | ||
COPY . /app | ||
|
||
# Install the quartz_solar_forecast package in editable mode | ||
RUN pip install -e . | ||
|
||
# Expose port 8000 to the outside world | ||
EXPOSE 8000 | ||
|
||
# Run the application using python main.py | ||
CMD ["python", "api/main.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import uvicorn | ||
|
||
if __name__ == "__main__": | ||
uvicorn.run("app.api:app", host="localhost", port=8000, reload=True) | ||
uvicorn.run("app.api:app", host="0.0.0.0", port=8000, reload=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters