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

bloated but functional #1160

Closed
wants to merge 1 commit into from
Closed
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
65 changes: 47 additions & 18 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,64 @@
# syntax=docker/dockerfile:1
# Based on https://docs.docker.com/samples/django/

FROM python:3.11-alpine
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1

ENV POETRY_NO_INTERACTION=1 \
# Environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache

# Set working directory
WORKDIR /code

# Configure locales
RUN apk update
RUN apk add --no-cache bash yaml-cpp
RUN apk add --no-cache py3-cffi libc-dev libffi-dev gcc python3-dev glib pango cairo
RUN apk add --no-cache musl musl-utils musl-locales tzdata lang
RUN apk add --no-cache gettext fontconfig ttf-freefont font-noto terminus-font
RUN apk add --no-cache file-dev gcc
# Install system dependencies
RUN apk update && apk add --no-cache \
bash \
yaml-cpp \
py3-cffi \
libc-dev \
libffi-dev \
gcc \
python3-dev \
glib \
pango \
cairo \
musl \
musl-utils \
musl-locales \
tzdata \
gettext \
fontconfig \
ttf-freefont \
font-noto \
terminus-font \
file-dev \
build-base \
freetype-dev \
libpng-dev \
openblas-dev \
cmake \
g++ \
libstdc++

# Copy project files
COPY . /code/
COPY pyproject.toml /code/
COPY poetry.lock /code/
COPY startup.sh /code/
COPY pyproject.toml poetry.lock* startup.sh /code/

# Install Poetry and project dependencies
RUN pip install --upgrade pip && \
pip install poetry==1.8.3
RUN poetry install
RUN rm -rf $POETRY_CACHE_DIR
pip install poetry==1.8.3 && \
poetry config virtualenvs.create false && \
poetry install --no-interaction --no-ansi && \
rm -rf $POETRY_CACHE_DIR

# Set executable permissions for startup script
RUN chmod +x /code/startup.sh

ENTRYPOINT ["poetry", "run", "bash", "startup.sh"]
# Expose port
EXPOSE 8000

# Entrypoint
ENTRYPOINT ["poetry", "run", "bash", "startup.sh"]
Loading