Skip to content

Commit

Permalink
Merge pull request #7 from PrivateAIM/6-add-dockerfile
Browse files Browse the repository at this point in the history
Add Dockerfile
  • Loading branch information
mjugl authored Feb 13, 2024
2 parents 520fbac + da226eb commit 6f1476d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM python:3.11-alpine AS builder

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

RUN pip install poetry==1.7.1 && \
poetry export -n --without dev -f requirements.txt -o requirements.txt

FROM python:3.11-alpine

WORKDIR /app

COPY ./config/ ./config/
COPY --from=builder /tmp/requirements.txt ./
COPY ./project/ ./project/

RUN pip install -r requirements.txt

# PYTHONPATH hack is needed here because /app contains the "project"
# module which is referenced in parts of the source code.
ENV PYTHONPATH=/app

CMD ["python", "project/main.py", "server", "--no-reload", "-p", "8080"]

0 comments on commit 6f1476d

Please sign in to comment.