2020-04-14 22:55:01 +08:00
|
|
|
FROM python:3
|
|
|
|
|
|
|
|
WORKDIR /usr/src/shynet
|
|
|
|
|
2020-04-15 04:41:00 +08:00
|
|
|
RUN apt update
|
|
|
|
RUN apt install -y gettext
|
|
|
|
|
2020-04-15 02:57:27 +08:00
|
|
|
# URL from https://github.com/shlinkio/shlink/issues/596 :)
|
|
|
|
RUN curl "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN&license_key=G4Lm0C60yJsnkdPi&suffix=tar.gz" | tar -xvz -C /tmp
|
|
|
|
RUN curl "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=G4Lm0C60yJsnkdPi&suffix=tar.gz" | tar -xvz -C /tmp
|
|
|
|
RUN mv /tmp/GeoLite2*/*.mmdb /etc
|
|
|
|
|
2020-04-14 22:55:01 +08:00
|
|
|
RUN pip install pipenv
|
|
|
|
COPY Pipfile.lock ./
|
|
|
|
COPY Pipfile ./
|
|
|
|
RUN pipenv install --system --deploy
|
|
|
|
|
|
|
|
COPY shynet .
|
|
|
|
RUN python manage.py collectstatic --noinput
|
2020-04-15 04:17:26 +08:00
|
|
|
RUN python manage.py compilemessages
|
2020-04-14 22:55:01 +08:00
|
|
|
|
|
|
|
ARG GF_UID="500"
|
|
|
|
ARG GF_GID="500"
|
|
|
|
|
|
|
|
# add group & user
|
|
|
|
RUN groupadd -r -g $GF_GID appgroup && \
|
|
|
|
useradd appuser -r -u $GF_UID -g appgroup
|
|
|
|
|
|
|
|
USER appuser
|
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
2020-05-01 04:59:04 +08:00
|
|
|
ENTRYPOINT [ "./entrypoint.sh" ]
|