-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Queensferry <queensferry.me@gmail.com>
- Loading branch information
1 parent
45f83ad
commit 4b00b37
Showing
2 changed files
with
30 additions
and
0 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 @@ | ||
**/__pycache__/ |
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,29 @@ | ||
FROM python:3.9-alpine | ||
|
||
# Setup | ||
RUN addgroup -S app && adduser -S app -G app | ||
RUN apk add --no-cache curl | ||
USER app | ||
|
||
# Copy | ||
ENV HOME=/home/app | ||
WORKDIR $HOME/app | ||
COPY --chown=app:app rsserpent rsserpent | ||
COPY --chown=app:app poetry.lock pyproject.toml . | ||
|
||
# Dependencies | ||
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - | ||
ENV PATH="${HOME}/.local/bin:${HOME}/.poetry/bin:${PATH}" | ||
RUN poetry config virtualenvs.create false && \ | ||
poetry add --lock uvicorn && \ | ||
poetry install --no-dev | ||
|
||
# Cleanup | ||
USER root | ||
RUN apk del curl | ||
RUN yes | poetry cache clear --all . | ||
USER app | ||
|
||
# Run | ||
EXPOSE 8000 | ||
CMD [ "uvicorn", "rsserpent:app", "--host", "0.0.0.0" ] |