correct some bug && add nginx

This commit is contained in:
Dryusdan 2017-11-23 21:55:46 +01:00
parent 59e497219e
commit a800e519a9
3 changed files with 45 additions and 7 deletions

View File

@ -1,4 +1,4 @@
FROM alpine:3.6
FROM xataz/nginx
ENV UID=991 GID=991

View File

@ -0,0 +1,38 @@
http {
gzip_static on;
server {
listen 8080;
root /diaspora/public;
# Configure maximum picture size
# Note that Diaspora has a client side check set at 4M
client_max_body_size 10M;
client_body_buffer_size 256K;
# Proxy if requested file not found
try_files $uri @diaspora;
location /assets/ {
expires max;
add_header Cache-Control public;
}
location @diaspora {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://diaspora_server;
}
}
# Proxy destination
# Add as many server directives as you want
# Also takes a socket, like unix:/path/to/some/socket.sock
upstream diaspora_server {
server unix:/run/diaspora/diaspora.sock;
}
}

View File

@ -4,18 +4,18 @@ addgroup -g ${GID} diaspora && adduser -H -s /bin/sh -D -G diaspora -u ${UID} di
if [ ! -f /config/database.yml ]; then
cp /diaspora/config/database.yml.example /config/database.yml
echo "/config/database.yml not found please configure it and restart your container"
sleep
ln -s /config/database.yml /diaspora/config/database.yml
read -p "/config/database.yml not found please configure it and restart your container"
fi
if [ ! -f /config/diaspora.yml ]; then
cp /diaspora/config/diaspora.yml.example /config/diaspora.yml
echo "/config/diaspora.yml not found please configure it and restart your container"
sleep
ln -s /config/diaspora.yml /diaspora/config/diaspora.yml
read -p "/config/diaspora.yml not found please configure it and restart your container"
fi
ln -s /config/database.yml /diaspora/config/database.yml
ln -s /config/diaspora.yml /diaspora/config/diaspora.yml
chown -R diaspora:diaspora /diaspora
cd /diaspora
exec su-exec diaspora:diaspora script/configure_bundler