2018-04-16 18:43:54 +00:00
|
|
|
# First, compile JS stuff
|
2020-04-25 16:51:49 +00:00
|
|
|
FROM node:dubnium-buster
|
2018-04-16 18:43:54 +00:00
|
|
|
WORKDIR /src/
|
|
|
|
COPY . .
|
2020-04-25 16:51:49 +00:00
|
|
|
RUN npm install -g requirejs uglify-js jade bower \
|
|
|
|
&& make init js
|
2018-04-16 18:43:54 +00:00
|
|
|
|
|
|
|
# Second, create virtualenv
|
2020-04-25 16:51:49 +00:00
|
|
|
FROM python:3.8-buster
|
2018-04-16 18:43:54 +00:00
|
|
|
WORKDIR /src/
|
|
|
|
COPY --from=0 /src .
|
|
|
|
RUN python3 -m venv /isso \
|
|
|
|
&& . /isso/bin/activate \
|
2020-04-25 16:51:49 +00:00
|
|
|
&& pip3 install --no-cache-dir --upgrade pip \
|
|
|
|
&& pip3 install --no-cache-dir gunicorn cffi flask \
|
|
|
|
&& python setup.py install \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
2018-04-16 18:43:54 +00:00
|
|
|
|
|
|
|
# Third, create final repository
|
2020-04-25 16:51:49 +00:00
|
|
|
FROM python:3.8-slim-buster
|
2018-04-16 18:43:54 +00:00
|
|
|
WORKDIR /isso/
|
|
|
|
COPY --from=1 /isso .
|
|
|
|
|
|
|
|
# Configuration
|
|
|
|
VOLUME /db /config
|
|
|
|
EXPOSE 8080
|
|
|
|
ENV ISSO_SETTINGS /config/isso.cfg
|
2020-04-25 16:51:49 +00:00
|
|
|
CMD ["/isso/bin/gunicorn", "-b", "0.0.0.0:8080", "-w", "4", "--preload", "isso.run", "--worker-tmp-dir", "/dev/shm"]
|
2018-04-16 18:43:54 +00:00
|
|
|
|
|
|
|
# Example of use:
|
|
|
|
#
|
|
|
|
# docker build -t isso .
|
|
|
|
# docker run -it --rm -v /opt/isso:/config -v /opt/isso:/db -v $PWD:$PWD isso /isso/bin/isso -c \$ISSO_SETTINGS import disqus.xml
|
|
|
|
# docker run -d --rm --name isso -p 8080:8080 -v /opt/isso:/config -v /opt/isso:/db isso
|