Skip to content

Commit

Permalink
poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
lAmeR1 committed May 1, 2024
1 parent 50ba626 commit ae4dd27
Show file tree
Hide file tree
Showing 5 changed files with 1,414 additions and 13 deletions.
19 changes: 8 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@ ENV KASPAD_HOST_1=n.seeder1.kaspad.net:16110
ARG version
ENV VERSION=$version

# Install & use pipenv
COPY Pipfile ./
RUN python -m pip install --upgrade pip
RUN pip install pipenv
RUN pipenv install -v
RUN apt update
RUN apt install uvicorn gunicorn -y

WORKDIR /app
COPY . /app
COPY poetry.lock pyproject.toml ./

# Creates a non-root user and adds permission to access the /app folder
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
USER appuser
RUN python -m pip install --upgrade pip
RUN pip install poetry
RUN poetry install --no-root --no-interaction

# ENTRYPOINT ["/usr/bin/dumb-init", "--"]
COPY . .

CMD pipenv run gunicorn -b 0.0.0.0:8000 -w 1 -k uvicorn.workers.UvicornWorker main:app --timeout 120
CMD poetry run gunicorn -b 0.0.0.0:8000 -w 4 -k uvicorn.workers.UvicornWorker main:app --timeout 120
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ aiohttp = "*"
aiocache = "*"

[requires]
python_version = "3"
python_version = "3.10"
Loading

0 comments on commit ae4dd27

Please sign in to comment.