Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: updated dockerfile to perform poetry installation + requirements automatically #167

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
FROM python:3.9-slim

# set work directory
WORKDIR /usr/src/app

# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# copy requirements file
COPY ./requirements.txt /usr/src/app/requirements.txt
# copy pyproject file to generate requirements.txt
ADD ./pyproject.toml /tmp/pyproject.toml

# install dependencies
WORKDIR /tmp
RUN apt update \
&& apt install git -y \
&& pip install --upgrade pip setuptools wheel \
&& pip install -r /usr/src/app/requirements.txt \
&& pip install --root-user-action ignore poetry \
&& poetry export -f requirements.txt --without-hashes --output ./requirements.txt \
&& pip install -r ./requirements.txt \
&& rm -rf /root/.cache/pip \
&& apt purge git -y

# copy project
COPY app/ /usr/src/app/
ADD app/ /usr/src/app/

CMD python index.py --host 0.0.0.0 --port 8050
WORKDIR /usr/src/app
CMD python index.py --host 0.0.0.0 --port 8050
Loading