Skip to content

Commit 3703135

Browse files
committed
[Dockerfile] Added INCLUDE_POSTGRESQL build argument, so one may build it with PostgreSQL support (#77)
1 parent dde8935 commit 3703135

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,19 @@ COPY "./app/requirements.txt" "./app/"
77
COPY "./config.py" "./"
88
COPY "./tasks" "./tasks"
99

10+
ARG INCLUDE_POSTGRESQL=false
1011
ARG INCLUDE_UWSGI=false
1112
RUN apk add --no-cache --virtual=.build_dependencies musl-dev gcc python3-dev libffi-dev linux-headers && \
1213
cd /opt/www && \
1314
pip install -r tasks/requirements.txt && \
1415
invoke app.dependencies.install && \
16+
( \
17+
if [ "$INCLUDE_POSTGRESQL" = 'true' ]; then \
18+
apk add --no-cache libpq && \
19+
apk add --no-cache --virtual=.build_dependencies postgresql-dev && \
20+
pip install psycopg2 ; \
21+
fi \
22+
) && \
1523
( if [ "$INCLUDE_UWSGI" = 'true' ]; then pip install uwsgi ; fi ) && \
1624
rm -rf ~/.cache/pip && \
1725
apk del .build_dependencies

0 commit comments

Comments
 (0)