forked from gitcoinco/web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (37 loc) · 1.76 KB
/
Dockerfile
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
FROM python:3.7-alpine3.8
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
ARG PACKAGES="postgresql-libs libxml2 libxslt freetype libffi jpeg libmaxminddb bash git tar gzip"
ARG BUILD_DEPS="gcc g++ postgresql-dev libxml2-dev libxslt-dev freetype-dev libffi-dev jpeg-dev linux-headers autoconf automake libtool make dos2unix"
WORKDIR /code
# Install general dependencies.
RUN apk add --no-cache --update $PACKAGES && \
apk add --no-cache --update --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ vips && \
apk add --no-cache --update --virtual .builder $BUILD_DEPS
# GeoIP2 Data Files
RUN mkdir -p /usr/share/GeoIP/ && \
wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz && \
wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz && \
gunzip GeoLite2-City.mmdb.gz && \
gunzip GeoLite2-Country.mmdb.gz && \
mv *.mmdb /usr/share/GeoIP/
# Upgrade package essentials.
RUN pip3 install --upgrade pip setuptools wheel dumb-init pipenv
COPY requirements/ /code/
RUN pip3 install --upgrade -r test.txt
COPY bin/docker-command.bash /bin/docker-command.bash
RUN dos2unix /bin/docker-command.bash && \
apk del .builder
COPY app/ /code/app/
ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
CMD ["bash", "/bin/docker-command.bash"]
ARG BUILD_DATETIME
ARG SHA1
LABEL co.gitcoin.description="Gitcoin web application image" \
co.gitcoin.documentation="https://github.com/gitcoinco/web/blob/master/docs/RUNNING_LOCALLY_DOCKER.md" \
co.gitcoin.licenses="AGPL-3.0" \
co.gitcoin.image.revision=$SHA1 \
co.gitcoin.image.vendor="Gitcoin" \
co.gitcoin.image.source="https://github.com/gitcoinco/web" \
co.gitcoin.image.title="Gitcoin Web" \
co.gitcoin.image.created=$BUILD_DATETIME