Skip to content

Commit fcf344c

Browse files
committed
chore(test): optimization Dockerfile.test
1 parent 0f922ed commit fcf344c

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

rootfs/Dockerfile.test

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,8 @@ FROM python:3.7-alpine
33
COPY requirements.txt /app/requirements.txt
44
COPY dev_requirements.txt /app/dev_requirements.txt
55

6-
RUN apk update \
7-
&& apk add postgresql==12.3-r2
8-
96
ENV PGDATA /var/lib/postgresql/12
10-
RUN mkdir -p /run/postgresql $PGDATA \
11-
&& chown -R postgres:postgres /run/postgresql $PGDATA \
12-
&& apk add --update --virtual .build-deps \
7+
RUN apk add --update --virtual .build-deps \
138
postgresql-dev \
149
gcc \
1510
libffi-dev \
@@ -31,7 +26,9 @@ RUN mkdir -p /run/postgresql $PGDATA \
3126
su-exec \
3227
bash \
3328
shadow \
34-
postgresql \
29+
postgresql==12.3-r2 \
30+
&& mkdir -p /run/postgresql $PGDATA \
31+
&& chown -R postgres:postgres /run/postgresql $PGDATA \
3532
&& apk del .build-deps \
3633
&& su-exec postgres initdb -D $PGDATA
3734

@@ -40,3 +37,4 @@ COPY . /app
4037
WORKDIR /app
4138
CMD ["/app/bin/boot"]
4239
EXPOSE 8000
40+

0 commit comments

Comments
 (0)