calibre-web-companion/Dockerfile

35 lines
1005 B
Docker

FROM python:3.9.1-slim-buster
RUN apt-get clean && \
apt-get update && \
apt-get install -y nginx smbclient default-libmysqlclient-dev \
gcc python3-cffi libcairo2 libpango-1.0-0 libpangocairo-1.0-0 \
libgdk-pixbuf2.0-0 libffi-dev shared-mime-info uwsgi-core
# set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN mkdir /cwebcomp
WORKDIR /cwebcomp
ADD . /cwebcomp/
# only add this next one if you have static files
RUN mkdir static
RUN pip install -r requirements.txt
RUN python CalibreWebCompanion/manage.py collectstatic
# only if you need celery
#RUN useradd -ms /bin/bash celery
#COPY broker/init.d_celeryd /etc/init.d/celeryd
#COPY broker/celeryd /etc/default/celeryd
# nginx config and script to be run
COPY deployment/docker/nginx.conf /etc/nginx/sites-available/default
COPY deployment/docker/start.sh /usr/local/bin/start.sh
# set proper file permissions
RUN chmod u+x /usr/local/bin/start.sh
EXPOSE 80
CMD ["/bin/bash", "-c", "start.sh"]