Skip to content

Commit

Permalink
Update EE backend dockerfile (#1420)
Browse files Browse the repository at this point in the history
* Update EE backend dockerfile

* missing library
  • Loading branch information
ab-smith authored Jan 24, 2025
1 parent 834dcad commit f5bb029
Showing 1 changed file with 48 additions and 29 deletions.
77 changes: 48 additions & 29 deletions enterprise/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,57 @@
# syntax=docker/dockerfile:1
# Based on https://docs.docker.com/samples/django/

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

ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache

ENV DJANGO_SETTINGS_MODULE=enterprise_core.settings
FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache \
DJANGO_SETTINGS_MODULE=enterprise_core.settings

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 g++ zlib-dev make python3-dev py3-numpy jpeg-dev
RUN apt-get update && apt-get install -y \
libyaml-cpp-dev \
libffi-dev \
libglib2.0-0 \
pango1.0-0 \
libcairo2 \
locales \
tzdata \
gettext \
fontconfig \
fonts-freefont-ttf \
build-essential \
python3-dev \
python3-numpy \
libjpeg-dev \
zlib1g-dev \
libmagic1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& locale-gen en_US.UTF-8 \
&& locale-gen ar_SA.UTF-8 \
&& locale-gen fr_FR.UTF-8 \
&& locale-gen pt_PT.UTF-8 \
&& locale-gen es_ES.UTF-8 \
&& locale-gen de_DE.UTF-8 \
&& locale-gen nl_NL.UTF-8 \
&& locale-gen it_IT.UTF-8 \
&& locale-gen pl_PL.UTF-8 \
&& locale-gen ro_RO.UTF-8 \
&& locale-gen hi_IN.UTF-8 \
&& locale-gen ur_PK.UTF-8 \
&& locale-gen cs_CZ.UTF-8 \
&& locale-gen sv_SE.UTF-8 \
&& locale-gen id_ID.UTF-8 \
&& pip install --no-cache-dir --upgrade pip poetry==2.0.1

COPY backend/pyproject.toml backend/poetry.lock ./
RUN poetry install --no-root \
&& rm -rf $POETRY_CACHE_DIR

COPY backend /code/
COPY enterprise/backend/enterprise_core /code/enterprise_core
COPY backend/startup.sh /code/
COPY backend/pyproject.toml /code/
COPY backend/poetry.lock /code/

RUN pip install --upgrade pip && \
pip install poetry==2.0.1

RUN poetry install
RUN rm -rf $POETRY_CACHE_DIR

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

0 comments on commit f5bb029

Please sign in to comment.