Skip to content

Commit f5bb029

Browse files
authored
Update EE backend dockerfile (#1420)
* Update EE backend dockerfile * missing library
1 parent 834dcad commit f5bb029

File tree

1 file changed

+48
-29
lines changed

1 file changed

+48
-29
lines changed

enterprise/backend/Dockerfile

+48-29
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,57 @@
1-
# syntax=docker/dockerfile:1
2-
# Based on https://docs.docker.com/samples/django/
3-
4-
FROM python:3.12-alpine
5-
ENV PYTHONUNBUFFERED=1
6-
ENV PYTHONDONTWRITEBYTECODE=1
7-
8-
ENV POETRY_NO_INTERACTION=1 \
9-
POETRY_VIRTUALENVS_IN_PROJECT=1 \
10-
POETRY_VIRTUALENVS_CREATE=1 \
11-
POETRY_CACHE_DIR=/tmp/poetry_cache
12-
13-
ENV DJANGO_SETTINGS_MODULE=enterprise_core.settings
1+
FROM python:3.12-slim
2+
ENV PYTHONUNBUFFERED=1 \
3+
PYTHONDONTWRITEBYTECODE=1 \
4+
POETRY_NO_INTERACTION=1 \
5+
POETRY_VIRTUALENVS_IN_PROJECT=1 \
6+
POETRY_VIRTUALENVS_CREATE=1 \
7+
POETRY_CACHE_DIR=/tmp/poetry_cache \
8+
DJANGO_SETTINGS_MODULE=enterprise_core.settings
149

1510
WORKDIR /code
1611

17-
# Configure locales
18-
RUN apk update
19-
RUN apk add --no-cache bash yaml-cpp
20-
RUN apk add --no-cache py3-cffi libc-dev libffi-dev gcc python3-dev glib pango cairo
21-
RUN apk add --no-cache musl musl-utils musl-locales tzdata lang
22-
RUN apk add --no-cache gettext fontconfig ttf-freefont font-noto terminus-font
23-
RUN apk add --no-cache file-dev gcc g++ zlib-dev make python3-dev py3-numpy jpeg-dev
12+
RUN apt-get update && apt-get install -y \
13+
libyaml-cpp-dev \
14+
libffi-dev \
15+
libglib2.0-0 \
16+
pango1.0-0 \
17+
libcairo2 \
18+
locales \
19+
tzdata \
20+
gettext \
21+
fontconfig \
22+
fonts-freefont-ttf \
23+
build-essential \
24+
python3-dev \
25+
python3-numpy \
26+
libjpeg-dev \
27+
zlib1g-dev \
28+
libmagic1 \
29+
&& apt-get clean \
30+
&& rm -rf /var/lib/apt/lists/* \
31+
&& locale-gen en_US.UTF-8 \
32+
&& locale-gen ar_SA.UTF-8 \
33+
&& locale-gen fr_FR.UTF-8 \
34+
&& locale-gen pt_PT.UTF-8 \
35+
&& locale-gen es_ES.UTF-8 \
36+
&& locale-gen de_DE.UTF-8 \
37+
&& locale-gen nl_NL.UTF-8 \
38+
&& locale-gen it_IT.UTF-8 \
39+
&& locale-gen pl_PL.UTF-8 \
40+
&& locale-gen ro_RO.UTF-8 \
41+
&& locale-gen hi_IN.UTF-8 \
42+
&& locale-gen ur_PK.UTF-8 \
43+
&& locale-gen cs_CZ.UTF-8 \
44+
&& locale-gen sv_SE.UTF-8 \
45+
&& locale-gen id_ID.UTF-8 \
46+
&& pip install --no-cache-dir --upgrade pip poetry==2.0.1
47+
48+
COPY backend/pyproject.toml backend/poetry.lock ./
49+
RUN poetry install --no-root \
50+
&& rm -rf $POETRY_CACHE_DIR
2451

2552
COPY backend /code/
2653
COPY enterprise/backend/enterprise_core /code/enterprise_core
2754
COPY backend/startup.sh /code/
28-
COPY backend/pyproject.toml /code/
29-
COPY backend/poetry.lock /code/
30-
31-
RUN pip install --upgrade pip && \
32-
pip install poetry==2.0.1
33-
34-
RUN poetry install
35-
RUN rm -rf $POETRY_CACHE_DIR
3655

37-
ENTRYPOINT ["poetry", "run", "bash", "startup.sh"]
3856
EXPOSE 8000
57+
ENTRYPOINT ["poetry", "run", "bash", "startup.sh"]

0 commit comments

Comments
 (0)