Spacebin
docker-compose.yml
YAML
services:
spacebin:
image: spacebinorg/spirit:v1.0.3
restart: always
environment:
- SPIRIT_CONNECTION_URI=postgres://spacebin:password@postgres:5432/spacebin?sslmode=disable
- SPIRIT_ANALYTICS='<script async defer data-website-id="13b3330f-512e-4c86-98c4-7cd1dfbb3551" src="https://umami.kafana.dev/umami.js"></script>'
ports:
- 9000:9000
depends_on:
- postgres
postgres:
image: postgres:16.3-alpine
restart: always
environment:
- POSTGRES_USER=spacebin
- POSTGRES_PASSWORD=password
- POSTGRES_DB=spacebin
volumes:
- ./postgres:/var/lib/postgresql/data
nginx:
image: nginx
restart: unless-stopped
volumes:
- ./nginx-config:/etc/nginx/conf.d
ports:
- 9001:80
nginx
- spacebin.conf
Nginx Configuration File
server {
listen 80;
listen [::]:80;
server_name example.domain.com;
error_log /var/log/nginx/example.domain.com_error.log;
access_log /var/log/nginx/example.domain.com_access.log;
location ^~ {
proxy_set_header Host $host:$server_port;
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 $scheme;
client_max_body_size 256M;
# Fix the "It appears that your reverse proxy set up is broken" error.
proxy_pass http://spacebin:9000;
proxy_read_timeout 90;
# Required for new HTTP-based CLI
proxy_http_version 1.1;
proxy_request_buffering off;
add_header Content-Security-Policy "default-src 'self' 'unsafe-inline' https: data:; base-uri 'self';";
}
#location ~ /\.(?!well-known).* {
# deny all;
# access_log off;
# log_not_found off;
#}
# add_header Content-Security-Policy upgrade-insecure-requests;
add_header Content-Security-Policy "default-src 'self' 'unsafe-inline' https: data:; base-uri 'self';";
proxy_set_header X-Forwarded-For $remote_addr;
#Compress and optimize delivery of files
gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_vary on;
gzip_types
application/atom+xml
application/javascript
application/json
application/ld+json
application/manifest+json
application/rss+xml
application/vnd.geo+json
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/bmp
image/svg+xml
image/x-icon
text/cache-manifest
text/css
text/plain
text/vcard
text/vnd.rim.location.xloc
text/vtt
text/x-component
text/x-cross-domain-policy;
# text/html is always compressed by gzip module
}