-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from c3sr/python_api
Add Python API
- Loading branch information
Showing
12 changed files
with
975 additions
and
18 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
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 |
---|---|---|
|
@@ -2,3 +2,7 @@ | |
.carml_config.yml | ||
*.out | ||
.env.companion | ||
*pycache/ | ||
.env* | ||
__pycache__/ | ||
*tmp* |
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
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,21 @@ | ||
# Use the official Python image from the Docker Hub | ||
FROM python:3.11-slim | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy the requirements.txt file into the container | ||
COPY requirements.txt . | ||
|
||
# Install the dependencies specified in the requirements.txt file | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the rest of the application code into the container | ||
COPY . . | ||
|
||
# Expose the port that the FastAPI app runs on | ||
EXPOSE 8000 | ||
|
||
# Command to run the FastAPI application with --reload for development | ||
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "8000"] | ||
|
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,20 @@ | ||
# Use the official Python image from the Docker Hub | ||
FROM python:3.11-slim | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy the requirements.txt file into the container | ||
COPY python_api/requirements.txt . | ||
|
||
# Install the dependencies specified in the requirements.txt file | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the rest of the application code into the container | ||
COPY python_api/ . | ||
|
||
# Expose the port that the FastAPI app runs on | ||
EXPOSE 8000 | ||
|
||
# Command to run the FastAPI application with --reload for development | ||
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "8000"] |
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,6 @@ | ||
# Installation | ||
```pip install -r req.txt``` | ||
|
||
# Running | ||
|
||
```fastapi run api.py --reload``` |
Oops, something went wrong.