-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.test
More file actions
42 lines (37 loc) · 1.11 KB
/
Dockerfile.test
File metadata and controls
42 lines (37 loc) · 1.11 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
FROM python:3.7-alpine
COPY requirements.txt /app/requirements.txt
COPY dev_requirements.txt /app/dev_requirements.txt
RUN apk update \
&& apk add postgresql==12.3-r2
ENV PGDATA /var/lib/postgresql/12
RUN mkdir -p /run/postgresql $PGDATA \
&& chown -R postgres:postgres /run/postgresql $PGDATA \
&& apk add --update --virtual .build-deps \
postgresql-dev \
gcc \
libffi-dev \
musl-dev \
openldap-dev \
&& 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 /usr/local \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)" \
&& apk add --update --virtual .controller-rundeps \
$runDeps \
git \
mercurial \
ca-certificates \
su-exec \
bash \
shadow \
postgresql \
&& apk del .build-deps \
&& su-exec postgres initdb -D $PGDATA
COPY . /app
WORKDIR /app
CMD ["/app/bin/boot"]
EXPOSE 8000