-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.test
More file actions
52 lines (48 loc) · 1.76 KB
/
Dockerfile.test
File metadata and controls
52 lines (48 loc) · 1.76 KB
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
50
51
52
FROM docker.io/drycc/base:bullseye
COPY requirements.txt /app/requirements.txt
COPY dev_requirements.txt /app/dev_requirements.txt
ENV PGDATA="/opt/drycc/postgresql/data" \
PYTHON_VERSION="3.10.2" \
REDIS_VERSION="6.2.6" \
RABBITMQ_VERSION="3.9.13" \
POSTGRES_VERSION="14.2" \
GOSU_VERSION="1.14"
RUN buildDeps='gcc rustc cargo libffi-dev musl-dev openssl'; \
install-packages mercurial ca-certificates git $buildDeps \
&& install-stack python $PYTHON_VERSION \
&& install-stack redis $REDIS_VERSION \
&& install-stack rabbitmq $RABBITMQ_VERSION \
&& install-stack postgresql $POSTGRES_VERSION \
&& install-stack gosu $GOSU_VERSION && . init-stack \
&& python3 -m venv /app/.venv \
&& source /app/.venv/bin/activate \
&& pip3 install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt \
&& pip3 install --disable-pip-version-check --no-cache-dir -r /app/dev_requirements.txt \
# cleanup
&& scanelp /app/.venv/lib > runtime.txt \
&& apt-get purge -y --auto-remove $buildDeps \
&& install-packages $(< runtime.txt) \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf \
/usr/share/doc \
/usr/share/man \
/usr/share/info \
/usr/share/locale \
/var/lib/apt/lists/* \
/var/log/* \
/var/cache/debconf/* \
/etc/systemd \
/lib/lsb \
/lib/udev \
/usr/lib/`echo $(uname -m)`-linux-gnu/gconv/IBM* \
/usr/lib/`echo $(uname -m)`-linux-gnu/gconv/EBC* \
&& mkdir -p /usr/share/man/man{1..8} \
&& mkdir -p /run/postgresql $PGDATA \
&& groupadd postgres && useradd -g postgres postgres \
&& chown -R postgres:postgres /run/postgresql $PGDATA \
&& gosu postgres initdb -D $PGDATA
COPY . /app
WORKDIR /app
CMD ["/app/bin/boot"]
EXPOSE 8000