Compare commits

...

3 commits

Author SHA1 Message Date
thomasabishop
e4d728d3c5 Merge branch 'main' of ssh://forgejo.systemsobscure.net:222/thomasabishop/self-host 2025-04-08 18:19:52 +01:00
thomasabishop
ad04ec3700 feat (service): setup rocketchat 2025-04-08 18:18:03 +01:00
thomasabishop
cfa42e290f chore (proxy): add informative comment about user UID/GID 2025-04-08 18:11:22 +01:00
3 changed files with 90 additions and 1 deletions

View file

@ -0,0 +1,36 @@
# HTTP configuration
# -- Redirect all HTTP requests to HTTPS port
server {
listen 80; # HTTP port
server_name rocketchat.systemsobscure.net;
location / {
return 301 https://$host$request_uri; # Variable is a placeholder for all requests to the server name
}
}
# HTTPS configuration
server {
listen 443 ssl;
server_name rocketchat.systemsobscure.net;
# SSL configuration
ssl_certificate /etc/letsencrypt/live/systemsobscure.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/systemsobscure.net/privkey.pem;
# Security headers
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
# Proxy Configuration
location / {
proxy_pass http://rocketchat:3000; # Docker network address
proxy_set_header Host $host;
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;
}
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}

View file

@ -2,7 +2,7 @@ services:
server: server:
image: codeberg.org/forgejo/forgejo:10 image: codeberg.org/forgejo/forgejo:10
container_name: forgejo container_name: forgejo
environment: environment: # Run as my user
- USER_UID=1000 - USER_UID=1000
- USER_GID=1000 - USER_GID=1000
restart: always restart: always

View file

@ -0,0 +1,53 @@
services:
mongo:
image: mongo:6.0
restart: always
container_name: rocketchat-mongodb
command: mongod --replSet rs0 --oplogSize 128
user: "1000:1000"
environment:
- MONGO_INITDB_ROOT_USERNAME=rocketchat
- MONGO_INITDB_ROOT_PASSWORD=${ROCKETCHAT_MONGO_PASSWORD}
volumes:
- /mnt/storagebox_alpha/rocketchat/mongo/db:/data/db
networks:
- rocketchat
mongo-init-replica:
image: mongo:6.0
restart: "no"
container_name: rocketchat-mongo-init
user: "1000:1000"
command: >
bash -c "sleep 10 && mongosh --host mongo --eval \"rs.initiate({ _id: 'rs0', members: [ { _id: 0, host: 'mongo:27017' } ]})\" && exit 0"
networks:
- rocketchat
rocketchat:
image: rocket.chat:latest
restart: always
container_name: rocketchat
environment:
- PORT=3000
- ROOT_URL=https://rocketchat.systemsobscure.net
- MONGO_URL=mongodb://rocketchat:${ROCKETCHAT_MONGO_PASSWORD}@mongo:27017/rocketchat?replicaSet=rs0&authSource=admin
- MONGO_OPLOG_URL=mongodb://rocketchat:${ROCKETCHAT_MONGO_PASSWORD}@mongo:27017/local?replicaSet=rs0&authSource=admin
- DEPLOY_METHOD=docker
- STATISTICS_COLLECTION=false
- UPDATE_CHECKING=false
volumes:
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
depends_on:
- mongo
ports:
- "8003:3000"
networks:
- rocketchat
- web
networks:
rocketchat:
driver: bridge
web:
external: true