2019-03-20 20:01:11 +00:00
|
|
|
# We use multi stage builds
|
|
|
|
FROM node:6-stretch-slim AS build
|
|
|
|
|
|
|
|
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq git jq python
|
|
|
|
RUN npm install -g bower
|
|
|
|
|
|
|
|
# install tini in this stage to avoid the need of jq and python
|
|
|
|
# in the final image
|
|
|
|
ADD docker-install-tini.sh /usr/local/bin/docker-install-tini.sh
|
|
|
|
RUN /usr/local/bin/docker-install-tini.sh
|
|
|
|
|
|
|
|
COPY . /cryptpad
|
|
|
|
WORKDIR /cryptpad
|
|
|
|
|
|
|
|
RUN npm install --production \
|
|
|
|
&& npm install -g bower \
|
|
|
|
&& bower install --allow-root
|
|
|
|
|
|
|
|
FROM node:6-stretch-slim
|
2016-12-29 21:02:03 +00:00
|
|
|
|
2019-01-11 06:10:19 +00:00
|
|
|
# You want USE_SSL=true if not putting cryptpad behind a proxy
|
|
|
|
ENV USE_SSL=false
|
2019-03-20 20:01:11 +00:00
|
|
|
ENV STORAGE="'./storage/file'"
|
2019-01-11 06:10:19 +00:00
|
|
|
ENV LOG_TO_STDOUT=true
|
2016-12-29 21:02:03 +00:00
|
|
|
|
2019-01-11 06:10:19 +00:00
|
|
|
# Persistent storage needs
|
2019-03-29 10:33:49 +00:00
|
|
|
VOLUME /cryptpad/cfg
|
2016-12-29 21:02:03 +00:00
|
|
|
VOLUME /cryptpad/datastore
|
|
|
|
VOLUME /cryptpad/customize
|
2019-01-11 06:10:19 +00:00
|
|
|
VOLUME /cryptpad/blobstage
|
|
|
|
VOLUME /cryptpad/pins
|
|
|
|
VOLUME /cryptpad/tasks
|
|
|
|
VOLUME /cryptpad/block
|
2019-03-19 15:01:05 +00:00
|
|
|
VOLUME /cryptpad/blob
|
|
|
|
VOLUME /cryptpad/blobstage
|
2016-12-29 21:02:03 +00:00
|
|
|
|
2019-03-20 20:01:11 +00:00
|
|
|
# Copy cryptpad and tini from the build container
|
|
|
|
COPY --from=build /sbin/tini /sbin/tini
|
|
|
|
COPY --from=build /cryptpad /cryptpad
|
|
|
|
|
2019-01-11 06:10:19 +00:00
|
|
|
WORKDIR /cryptpad
|
|
|
|
|
|
|
|
# Unsafe / Safe ports
|
|
|
|
EXPOSE 3000 3001
|
|
|
|
|
|
|
|
# Run cryptpad on startup
|
2019-03-20 20:01:11 +00:00
|
|
|
CMD ["/sbin/tini", "--", "/cryptpad/container-start.sh"]
|