Initial commit

This commit is contained in:
Norbert Tretkowski 2025-05-22 06:54:23 +02:00
commit 7954ae4bd3
Signed by: norbert
GPG key ID: EAA31A3693AAB231
7 changed files with 367 additions and 0 deletions

View file

@ -0,0 +1,55 @@
services:
certbot:
restart: "no"
image: certbot/certbot:v3.1.0
command: certonly --standalone --noninteractive --email norbert@tretkowski.de --agree-tos --domains mollysocket.tretkowski.de
volumes:
- $PWD/certs:/etc/letsencrypt
ports:
- "80:80"
- "443:443"
networks:
- external
- internal
nginx:
image: nginx:1.27.3-alpine-slim
restart: unless-stopped
depends_on:
- mollysocket
volumes:
- $PWD/certs:/etc/letsencrypt:ro
- $PWD/nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- "80:80"
- "443:443"
networks:
- external
- internal
mollysocket:
image: ghcr.io/mollyim/mollysocket:1.6.0-alpine
container_name: mollysocket
restart: always
volumes:
- ./data:/data
working_dir: /data
command: server
environment:
- MOLLY_DB="/data/mollysocket.db"
- MOLLY_ALLOWED_ENDPOINTS=["https://up.conversations.im/","https://ntfy.sh/"]
- MOLLY_ALLOWED_UUIDS=["7d6ffb3e-6a0d-4335-8e6e-7acee0d20d34"]
#- MOLLY_VAPID_PRIVKEY="paste output of `docker compose run mollysocket vapid gen` here"
- MOLLY_HOST=0.0.0.0
- MOLLY_PORT=8020
- RUST_LOG=info
ports:
- "127.0.0.1:8020:8020"
networks:
- external
- internal
networks:
external:
internal:
internal: true

34
mollysocket/nginx.conf Normal file
View file

@ -0,0 +1,34 @@
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 80;
listen [::]:80;
server_name mollysocket.tretkowski.de;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name mollysocket.tretkowski.de;
ssl_certificate /etc/letsencrypt/live/mollysocket.tretkowski.de/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mollysocket.tretkowski.de/privkey.pem;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://mollysocket:8020;
}
}
}