cryptpad/Dockerfile

49 lines
1.2 KiB
Docker
Raw Normal View History

# 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-30 05:02:03 +08:00
# You want USE_SSL=true if not putting cryptpad behind a proxy
ENV USE_SSL=false
ENV STORAGE="'./storage/file'"
ENV LOG_TO_STDOUT=true
2016-12-30 05:02:03 +08:00
# Persistent storage needs
2019-03-29 18:33:49 +08:00
VOLUME /cryptpad/cfg
2016-12-30 05:02:03 +08:00
VOLUME /cryptpad/datastore
VOLUME /cryptpad/customize
VOLUME /cryptpad/blobstage
VOLUME /cryptpad/pins
VOLUME /cryptpad/tasks
VOLUME /cryptpad/block
2019-03-19 23:01:05 +08:00
VOLUME /cryptpad/blob
VOLUME /cryptpad/blobstage
VOLUME /cryptpad/data
2016-12-30 05:02:03 +08:00
# Copy cryptpad and tini from the build container
COPY --from=build /sbin/tini /sbin/tini
COPY --from=build /cryptpad /cryptpad
WORKDIR /cryptpad
# Unsafe / Safe ports
EXPOSE 3000 3001
# Run cryptpad on startup
CMD ["/sbin/tini", "--", "/cryptpad/container-start.sh"]