From 2b955ff43c15cb95e134c8a6a5b052bf02395b61 Mon Sep 17 00:00:00 2001 From: Asharas Date: Mon, 8 Feb 2021 04:15:16 +0100 Subject: [PATCH] Remove leftover nginx directory --- nginx/Dockerfile | 50 -------------------------------- nginx/Dockerfile-alpine | 64 ----------------------------------------- nginx/startup.sh | 2 -- nginx/supervisord.conf | 28 ------------------ 4 files changed, 144 deletions(-) delete mode 100644 nginx/Dockerfile delete mode 100644 nginx/Dockerfile-alpine delete mode 100644 nginx/startup.sh delete mode 100644 nginx/supervisord.conf diff --git a/nginx/Dockerfile b/nginx/Dockerfile deleted file mode 100644 index a9bda57..0000000 --- a/nginx/Dockerfile +++ /dev/null @@ -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"] diff --git a/nginx/Dockerfile-alpine b/nginx/Dockerfile-alpine deleted file mode 100644 index 4020eca..0000000 --- a/nginx/Dockerfile-alpine +++ /dev/null @@ -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"] diff --git a/nginx/startup.sh b/nginx/startup.sh deleted file mode 100644 index f682536..0000000 --- a/nginx/startup.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /bin/bash - diff --git a/nginx/supervisord.conf b/nginx/supervisord.conf deleted file mode 100644 index f948a60..0000000 --- a/nginx/supervisord.conf +++ /dev/null @@ -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 -