mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 16:14:48 +01:00
* Misc improvements, including fixes from @funkyfuture: - Dockerfile: Reduces number of created layers and source contents - Support for automatic collection creation if INIT_COLLECTION is defined - Add entry point script docker-entrypoint.sh - update to latest python (3.7.2 currently) - additions to .dockerignore - setup.py and requirements cleanup (just use plain 'gevent' requirement) * docker-entrypoint.sh improvements: - before running cmd, match uid/gid to that of volume dir (specified via $VOLUME_DIR, defaulting to /webarchive) - if volume is owned by root (default if none mounted), just run as root - if volume is owned by different user, create/update user 'archivist' to match the uid/gid of $VOLUME_DIR, then run cmd as 'su archivist'
35 lines
621 B
Docker
Executable File
35 lines
621 B
Docker
Executable File
ARG PYTHON=python:3.7.2
|
|
|
|
FROM $PYTHON
|
|
|
|
WORKDIR /pywb
|
|
|
|
COPY requirements.txt extra_requirements.txt ./
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt -r extra_requirements.txt
|
|
|
|
COPY . ./
|
|
|
|
RUN python setup.py install \
|
|
&& mv ./docker-entrypoint.sh / \
|
|
&& mkdir /uwsgi && mv ./uwsgi.ini /uwsgi/ \
|
|
&& mkdir /webarchive && mv ./config.yaml /webarchive/
|
|
|
|
WORKDIR /webarchive
|
|
|
|
# auto init collection
|
|
ENV INIT_COLLECTION ''
|
|
|
|
ENV VOLUME_DIR /webarchive
|
|
|
|
#USER archivist
|
|
COPY docker-entrypoint.sh ./
|
|
|
|
# volume and port
|
|
VOLUME /webarchive
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
CMD ["uwsgi", "/uwsgi/uwsgi.ini"]
|
|
|