51 lines
1.1 KiB
Text
51 lines
1.1 KiB
Text
|
FROM alpine:3.12
|
||
|
WORKDIR /opt/app
|
||
|
|
||
|
RUN \
|
||
|
apk --no-cache add \
|
||
|
python3 \
|
||
|
ffmpeg \
|
||
|
py3-pip \
|
||
|
# from requirements.txt:
|
||
|
py3-yaml \
|
||
|
py3-psycopg2 \
|
||
|
py3-sqlalchemy \
|
||
|
py3-certifi \
|
||
|
py3-numpy \
|
||
|
py3-pillow \
|
||
|
py3-pynacl \
|
||
|
py3-tz \
|
||
|
py3-pyrfc3339 \
|
||
|
# for testing
|
||
|
py3-pytest \
|
||
|
py3-pytest-cov \
|
||
|
postgresql \
|
||
|
&& \
|
||
|
pip3 install --no-cache-dir --disable-pip-version-check \
|
||
|
alembic \
|
||
|
"coloredlogs==5.0" \
|
||
|
youtube-dl \
|
||
|
# for testing
|
||
|
pytest-pgsql \
|
||
|
freezegun \
|
||
|
&& apk --no-cache del py3-pip
|
||
|
|
||
|
ARG PUID=1000
|
||
|
ARG PGID=1000
|
||
|
RUN \
|
||
|
# Set users
|
||
|
mkdir -p /opt/app /data && \
|
||
|
addgroup -g ${PGID} app && \
|
||
|
adduser -SDH -h /opt/app -g '' -G app -u ${PUID} app && \
|
||
|
chown -R app:app /opt/app /data
|
||
|
USER app
|
||
|
|
||
|
ENV POSTGRES_HOST=x \
|
||
|
POSTGRES_USER=x \
|
||
|
POSTGRES_PASSWORD=x
|
||
|
|
||
|
COPY --chown=app:app ./ /opt/app/
|
||
|
|
||
|
ENTRYPOINT ["pytest", "--tb=short"]
|
||
|
CMD ["--cov-report=term-missing:skip-covered", "--cov=szurubooru", "szurubooru/"]
|