-
Notifications
You must be signed in to change notification settings - Fork 23
/
Dockerfile
49 lines (40 loc) · 1.11 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM python:3.11.1-slim as builder
# copy project
COPY ./src /app
WORKDIR /app
# Update system environment
ENV PYTHON_VERSION=3.10
ENV DEBIAN_FRONTEND noninteractive
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Update system defaults
RUN apt-get update && \
apt-get install -y \
locales \
libmemcached-dev \
libpq-dev \
libjpeg-dev \
zlib1g-dev \
build-essential \
python3-dev \
python3-setuptools \
gcc \
make && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Update Locales
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& locale-gen && dpkg-reconfigure locales
# Install Python deps
RUN python3 -m venv /opt/venv && \
/opt/venv/bin/python -m pip install pip --upgrade && \
/opt/venv/bin/python -m pip install -r /app/requirements.txt
# Purge unused
RUN apt-get remove -y --purge make gcc build-essential \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# Make local files executable
RUN chmod +x config/migrate.sh && \
chmod +x config/entrypoint.sh
CMD [ "./config/entrypoint.sh" ]