Add CrisisCleanup3 to graveyard (cherry-picked from 2018-08-10)

This commit is contained in:
Disassembler 2020-04-11 16:52:28 +02:00
parent 8771ac9828
commit e5574db63c
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
7 changed files with 141 additions and 0 deletions

View File

@ -0,0 +1,31 @@
FROM alpine
MAINTAINER Disassembler <disassembler@dasm.cz>
RUN \
# Install runtime dependencies
apk --no-cache add nodejs nginx
RUN \
# Install build dependencies
apk --no-cache add --virtual .deps git yarn
# Clone CrisisCleanup
&& git clone --depth 1 https://github.com/CrisisCleanup/crisiscleanup-web /srv/crisiscleanup \
# Install NodeJS dependencies
&& cd /srv/crisiscleanup \
&& yarn install \
# Generate static resources
&& APP_ENV=prod yarn run build \
# Create OS user
&& addgroup -S -g 8005 cc \
&& adduser -S -u 8005 -h /srv/crisiscleanup -s /bin/false -g cc -G cc cc \
&& chown -R cc:cc /srv/crisiscleanup \
# Cleanup
&& apk --no-cache del .deps \
&& find /srv/crisiscleanup -name '.git*' -exec rm -rf {} + \
&& rm -rf /usr/local/share/.cache
VOLUME ["/srv/crisiscleanup/config"]
EXPOSE 8080
WORKDIR /srv/crisiscleanup
CMD ["s6-svscan", "/etc/services.d"]

View File

@ -0,0 +1,64 @@
user nginx;
pid /run/nginx.pid;
worker_processes 1;
error_log /dev/stderr warn;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
access_log off;
server_tokens off;
client_max_body_size 100m;
sendfile on;
server {
listen 8080;
server_name localhost;
root /srv/kanboard;
index index.php;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/kanboard.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTP_HOST $http_x_forwarded_host if_not_empty;
fastcgi_param HTTPS "on";
fastcgi_param REQUEST_SCHEME "https";
fastcgi_param SERVER_NAME $http_x_forwarded_server_name if_not_empty;
fastcgi_param SERVER_PORT $http_x_forwarded_server_port if_not_empty;
}
location ~* ^.+\.(log|sqlite)$ {
return 404;
}
location ~ /\.ht {
return 404;
}
location ~* ^.+\.(ico|jpg|gif|png|css|js|svg|eot|ttf|woff|woff2|otf)$ {
log_not_found off;
expires 7d;
etag on;
}
gzip on;
gzip_comp_level 3;
gzip_disable "msie6";
gzip_vary on;
gzip_types text/javascript application/javascript application/json text/xml application/xml application/rss+xml text/css text/plain;
}
}

View File

@ -0,0 +1,3 @@
#!/bin/sh
/bin/true

View File

@ -0,0 +1,6 @@
#!/bin/execlineb -P
fdmove -c 2 1
s6-setuidgid 8005:8005
foreground { /srv/crisiscleanup/load-env.sh }
/usr/bin/node /srv/crisiscleanup/server.js

View File

@ -0,0 +1,3 @@
#!/bin/execlineb -P
/usr/sbin/nginx -g "daemon off;"

View File

@ -0,0 +1,29 @@
#!/sbin/openrc-run
description="Crisis Cleanup docker container"
depend() {
need docker postfix postgres
}
start() {
/usr/bin/docker run -d --rm \
--name crisiscleanup \
-h crisiscleanup \
--link postfix \
--link postgres \
-v /srv/crisiscleanup/conf:/srv/crisiscleanup/config \
crisiscleanup
}
start_post() {
/usr/bin/spotter-appmgr register-proxy crisiscleanup
}
stop_pre() {
/usr/bin/spotter-appmgr unregister-proxy crisiscleanup
}
stop() {
/usr/bin/docker stop crisiscleanup
}

View File

@ -0,0 +1,5 @@
GOOGLE_MAPS_API_KEY=AIzaSyAS7GowniFU4IZMZUEw0rVPyzY1EcWGXNU
LEAFLET_MAP_APP_ID=OxegEAQ46ansqN9LtNd1
LEAFLET_MAP_APP_CODE=86XV8M-pIbpy5TUa9H_Aww
API_ENDPOINT=https://prod-api.crisiscleanup.services http://localhost:5000
API_PHONE_ENDPOINT=https://staging-api.crisiscleanup.services