mirror of
https://github.com/xwiki-labs/cryptpad-docker.git
synced 2024-11-26 06:53:38 +00:00
Remove leftover nginx directory
This commit is contained in:
parent
ad57fa7fb5
commit
2b955ff43c
4 changed files with 0 additions and 144 deletions
|
@ -1,50 +0,0 @@
|
||||||
# Multistage build to reduce image size and increase security
|
|
||||||
FROM node:12-buster-slim AS build
|
|
||||||
|
|
||||||
# Install requirements to clone repository and install deps
|
|
||||||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq git
|
|
||||||
RUN npm install -g bower
|
|
||||||
|
|
||||||
# Create folder for cryptpad
|
|
||||||
RUN mkdir /cryptpad
|
|
||||||
WORKDIR /cryptpad
|
|
||||||
|
|
||||||
# Get cryptpad from repository submodule
|
|
||||||
COPY cryptpad /cryptpad
|
|
||||||
|
|
||||||
RUN sed -i "s@//httpAddress: '::'@httpAddress: '0.0.0.0'@" /cryptpad/config/config.example.js
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
RUN npm install --production \
|
|
||||||
&& npm install -g bower \
|
|
||||||
&& bower install --allow-root
|
|
||||||
|
|
||||||
# Create actual cryptpad image
|
|
||||||
FROM node:12-buster-slim
|
|
||||||
|
|
||||||
# Create user and group for cryptpad so it does not run as root
|
|
||||||
RUN groupadd cryptpad -g 4001
|
|
||||||
RUN useradd cryptpad -u 4001 -g 4001 -d /cryptpad
|
|
||||||
|
|
||||||
# Copy cryptpad with installed modules
|
|
||||||
COPY --from=build --chown=cryptpad /cryptpad /cryptpad
|
|
||||||
USER cryptpad
|
|
||||||
|
|
||||||
# Set workdir to cryptpad
|
|
||||||
WORKDIR /cryptpad
|
|
||||||
|
|
||||||
# Create directories
|
|
||||||
RUN mkdir blob block customize data datastore
|
|
||||||
|
|
||||||
# Volumes for data persistence
|
|
||||||
VOLUME /cryptpad/blob
|
|
||||||
VOLUME /cryptpad/block
|
|
||||||
VOLUME /cryptpad/customize
|
|
||||||
VOLUME /cryptpad/data
|
|
||||||
VOLUME /cryptpad/datastore
|
|
||||||
|
|
||||||
# Ports
|
|
||||||
EXPOSE 3000 3001
|
|
||||||
|
|
||||||
# Run cryptpad on startup
|
|
||||||
CMD ["server.js"]
|
|
|
@ -1,64 +0,0 @@
|
||||||
# Multistage build to reduce image size and increase security
|
|
||||||
FROM node:12-alpine AS build
|
|
||||||
|
|
||||||
# Install requirements to clone repository and install deps
|
|
||||||
RUN apk add --no-cache git
|
|
||||||
RUN npm install -g bower
|
|
||||||
|
|
||||||
# Create folder for cryptpad
|
|
||||||
RUN mkdir /cryptpad
|
|
||||||
WORKDIR /cryptpad
|
|
||||||
|
|
||||||
# Get cryptpad from repository submodule
|
|
||||||
COPY cryptpad /cryptpad
|
|
||||||
|
|
||||||
RUN sed -i "s@//httpAddress: '::'@httpAddress: '0.0.0.0'@" /cryptpad/config/config.example.js
|
|
||||||
RUN sed -i "s@httpUnsafeOrigin: '(.*)'@httpUnsafeOrigin: process.env.CRYPTPAD_HTTP_UNSAFE_ORIGIN@" /cryptpad/config/config.example.js
|
|
||||||
RUN sed -i 's@// httpSafeOrigin: "(.*)""@httpSafeOrigin: process.env.CRYPTPAD_HTTP_SAFE_ORIGIN@' /cryptpad/config/config.example.js
|
|
||||||
|
|
||||||
# Install dependencies
|
|
||||||
RUN npm install --production \
|
|
||||||
&& npm install -g bower \
|
|
||||||
&& bower install --allow-root
|
|
||||||
|
|
||||||
# Create actual cryptpad image
|
|
||||||
FROM node:12-alpine
|
|
||||||
|
|
||||||
ENV CRYPTPAD_HTTP_UNSAFE_ORIGIN http://localhost:3001
|
|
||||||
ENV CRYPTPAD_HTTP_SAFE_ORIGIN http://localhost:3001
|
|
||||||
|
|
||||||
# Install process management tool
|
|
||||||
RUN apk add --no-cache supervisor nginx
|
|
||||||
|
|
||||||
# Create user and group for cryptpad so it does not run as root
|
|
||||||
RUN addgroup -g 4001 -S cryptpad \
|
|
||||||
&& adduser -u 4001 -S -D -g 4001 -H -h /cryptpad cryptpad
|
|
||||||
|
|
||||||
# Copy cryptpad with installed modules
|
|
||||||
COPY --from=build --chown=cryptpad /cryptpad /cryptpad
|
|
||||||
USER cryptpad
|
|
||||||
|
|
||||||
# Set workdir to cryptpad
|
|
||||||
WORKDIR /cryptpad
|
|
||||||
|
|
||||||
# Create directories
|
|
||||||
RUN mkdir blob block customize data datastore
|
|
||||||
|
|
||||||
# Volumes for data persistence
|
|
||||||
VOLUME /cryptpad/blob
|
|
||||||
VOLUME /cryptpad/block
|
|
||||||
VOLUME /cryptpad/customize
|
|
||||||
VOLUME /cryptpad/data
|
|
||||||
VOLUME /cryptpad/datastore
|
|
||||||
|
|
||||||
# Start supervisord as root
|
|
||||||
USER root
|
|
||||||
|
|
||||||
# Configure supervisord
|
|
||||||
ADD nginx/supervisord.conf /etc/supervisor/supervisord.conf
|
|
||||||
|
|
||||||
# Ports
|
|
||||||
EXPOSE 3000 3001
|
|
||||||
|
|
||||||
# Run supervisord on startup
|
|
||||||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
|
|
@ -1,2 +0,0 @@
|
||||||
#! /bin/bash
|
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
[supervisord]
|
|
||||||
nodaemon=true
|
|
||||||
logfile=/dev/null
|
|
||||||
logfile_maxbytes=0
|
|
||||||
pidfile=/run/supervisord.pid
|
|
||||||
|
|
||||||
[program:cryptpad]
|
|
||||||
directory=/cryptpad
|
|
||||||
command=node server.js
|
|
||||||
user=cryptpad
|
|
||||||
group=cryptpad
|
|
||||||
environment=HOME="/cryptpad",USER="cryptpad",CRYPTPAD_HTTP_UNSAFE_ORIGIN=%(ENV_CRYPTPAD_HTTP_UNSAFE_ORIGIN)s,CRYPTPAD_HTTP_SAFE_ORIGIN=%(ENV_CRYPTPAD_HTTP_SAFE_ORIGIN)s
|
|
||||||
stdout_logfile=/dev/stdout
|
|
||||||
stdout_logfile_maxbytes=0
|
|
||||||
stderr_logfile=/dev/stderr
|
|
||||||
stderr_logfile_maxbytes=0
|
|
||||||
autorestart=false
|
|
||||||
startretries=0
|
|
||||||
|
|
||||||
;[program:nginx]
|
|
||||||
;command=nginx -g 'daemon off;'
|
|
||||||
;stdout_logfile=/dev/stdout
|
|
||||||
;stdout_logfile_maxbytes=0
|
|
||||||
;stderr_logfile=/dev/stderr
|
|
||||||
;stderr_logfile_maxbytes=0
|
|
||||||
;autorestart=false
|
|
||||||
;startretries=0
|
|
||||||
|
|
Loading…
Reference in a new issue