correct some bug && add nginx
This commit is contained in:
parent
59e497219e
commit
a800e519a9
|
@ -1,4 +1,4 @@
|
||||||
FROM alpine:3.6
|
FROM xataz/nginx
|
||||||
|
|
||||||
ENV UID=991 GID=991
|
ENV UID=991 GID=991
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -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
|
if [ ! -f /config/database.yml ]; then
|
||||||
cp /diaspora/config/database.yml.example /config/database.yml
|
cp /diaspora/config/database.yml.example /config/database.yml
|
||||||
echo "/config/database.yml not found please configure it and restart your container"
|
ln -s /config/database.yml /diaspora/config/database.yml
|
||||||
sleep
|
read -p "/config/database.yml not found please configure it and restart your container"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f /config/diaspora.yml ]; then
|
if [ ! -f /config/diaspora.yml ]; then
|
||||||
cp /diaspora/config/diaspora.yml.example /config/diaspora.yml
|
cp /diaspora/config/diaspora.yml.example /config/diaspora.yml
|
||||||
echo "/config/diaspora.yml not found please configure it and restart your container"
|
ln -s /config/diaspora.yml /diaspora/config/diaspora.yml
|
||||||
sleep
|
read -p "/config/diaspora.yml not found please configure it and restart your container"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ln -s /config/database.yml /diaspora/config/database.yml
|
|
||||||
ln -s /config/diaspora.yml /diaspora/config/diaspora.yml
|
|
||||||
chown -R diaspora:diaspora /diaspora
|
chown -R diaspora:diaspora /diaspora
|
||||||
cd /diaspora
|
cd /diaspora
|
||||||
exec su-exec diaspora:diaspora script/configure_bundler
|
exec su-exec diaspora:diaspora script/configure_bundler
|
||||||
|
|
Reference in New Issue