-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.test
More file actions
50 lines (44 loc) · 1.36 KB
/
Dockerfile.test
File metadata and controls
50 lines (44 loc) · 1.36 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
FROM docker.io/library/python:3.9-alpine
COPY requirements.txt /app/requirements.txt
COPY dev_requirements.txt /app/dev_requirements.txt
ENV PGDATA /var/lib/postgresql/12
ENV PATH="/app/.venv/bin:${PATH}"
RUN echo https://dl-cdn.alpinelinux.org/alpine/edge/main >>/etc/apk/repositories \
&& apk add --update --virtual .build-deps \
gcc \
rust \
cargo \
postgresql-dev \
libffi-dev \
musl-dev \
openssl-dev \
&& 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 \
&& runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /app/.venv \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /app/.venv/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)" \
&& apk add --update --virtual .controller-rundeps \
$runDeps \
git \
mercurial \
ca-certificates \
su-exec \
bash \
shadow \
postgresql \
redis \
rabbitmq-server \
&& mkdir -p /run/postgresql $PGDATA \
&& chown -R postgres:postgres /run/postgresql $PGDATA \
&& apk del .build-deps \
&& su-exec postgres initdb -D $PGDATA
COPY . /app
ENV PATH /app/.venv/bin:/app/bin:$PATH
WORKDIR /app
CMD ["/app/bin/boot"]
EXPOSE 8000