-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tag github workflow, and simplified prod file TODO: Investigate c…
…hanging to 1 dockerfile for repo #5
- Loading branch information
1 parent
05a7082
commit 4e06f88
Showing
2 changed files
with
17 additions
and
22 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 |
---|---|---|
@@ -1,28 +1,14 @@ | ||
FROM python:3.12.7-alpine3.20@sha256:edd1d8559c585e1e9a9b79de44ac27f8ac32cb0c7323e112ae6870ceeecd8dbf AS builder | ||
|
||
COPY requirements.txt ./ | ||
|
||
RUN set -eux; \ | ||
\ | ||
# Install pip dependencies \ | ||
python3 -m pip install --no-cache-dir -r requirements.txt; | ||
|
||
FROM python:3.12.7-alpine3.20@sha256:edd1d8559c585e1e9a9b79de44ac27f8ac32cb0c7323e112ae6870ceeecd8dbf | ||
|
||
WORKDIR /object-storage-api-run | ||
|
||
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages | ||
COPY --from=builder /usr/local/bin /usr/local/bin | ||
|
||
COPY README.md ./ | ||
COPY requirements.txt ./ | ||
COPY object_storage_api/ object_storage_api/ | ||
|
||
RUN set -eux; \ | ||
RUN --mount=type=cache,target=/root/.cache \ | ||
set -eux; \ | ||
\ | ||
# Create loging.ini from its .example file \ | ||
cp object_storage_api/logging.example.ini object_storage_api/logging.ini; | ||
|
||
USER nobody | ||
python3 -m pip install -r requirements.txt; | ||
|
||
CMD ["uvicorn", "object_storage_api.main:app", "--app-dir", "/object-storage-api-run", "--host", "0.0.0.0", "--port", "8000"] | ||
CMD ["fastapi", "run", "object_storage_api/main.py", "--host", "0.0.0.0", "--port", "8000"] | ||
EXPOSE 8000 |