szurubooru/server/Dockerfile

31 lines
712 B
Text
Raw Normal View History

FROM python:3.6-slim
WORKDIR /opt/app
2019-09-28 05:15:34 +02:00
COPY requirements.txt ./requirements.txt
RUN \
# Install ffmpeg
apt-get -yqq update && \
apt-get -yq install --no-install-recommends ffmpeg && \
rm -rf /var/lib/apt/lists/* && \
# Install waitress
2019-09-28 05:15:34 +02:00
pip3 install --no-cache-dir waitress && \
# Install app requirements
pip3 install --no-cache-dir -r ./requirements.txt
2019-09-28 05:15:34 +02:00
COPY ./ /opt/app/
2019-09-28 05:15:34 +02:00
ARG PUID=1000
ARG PGID=1000
RUN \
# Set users
mkdir -p /opt/app /data && \
groupadd -g ${PGID} app && \
useradd -d /opt/app -M -c '' -g app -r -u ${PUID} app && \
chown -R app:app /opt/app /data
USER app
2019-09-28 05:15:34 +02:00
ENV PORT=6666
EXPOSE ${PORT}
2019-09-28 05:15:34 +02:00
VOLUME ["/data/"]
CMD ["/opt/app/docker-start.sh"]