2024-02-25 19:32:36 +03:00
|
|
|
FROM python:alpine
|
2024-02-25 21:16:34 +03:00
|
|
|
|
|
|
|
# Update package lists and install necessary dependencies
|
|
|
|
RUN apk update && \
|
2024-02-29 07:56:23 +03:00
|
|
|
apk add --no-cache build-base icu-data-full curl python3-dev musl-dev && \
|
2024-02-25 21:16:34 +03:00
|
|
|
curl -sSL https://install.python-poetry.org | python
|
|
|
|
|
|
|
|
# Set working directory
|
2024-02-25 19:32:36 +03:00
|
|
|
WORKDIR /app
|
2024-02-25 19:27:41 +03:00
|
|
|
|
2024-02-25 21:16:34 +03:00
|
|
|
# Copy only the pyproject.toml file initially
|
|
|
|
COPY pyproject.toml /app/
|
|
|
|
|
|
|
|
# Install poetry and dependencies
|
|
|
|
RUN pip install poetry && \
|
|
|
|
poetry config virtualenvs.create false && \
|
|
|
|
poetry install --no-root --only main
|
2024-04-07 13:45:59 -03:00
|
|
|
|
2024-02-25 21:16:34 +03:00
|
|
|
# Copy the rest of the application
|
|
|
|
COPY . /app
|
2024-02-17 13:21:52 +03:00
|
|
|
|
2024-02-25 21:16:34 +03:00
|
|
|
# Expose the port
|
2024-01-27 11:48:24 +03:00
|
|
|
EXPOSE 8000
|
|
|
|
|
2024-02-17 13:21:52 +03:00
|
|
|
CMD ["python", "server.py"]
|