Skip to content

Instantly share code, notes, and snippets.

@CodeZombie
Last active September 13, 2022 06:59
Show Gist options
  • Save CodeZombie/1dd9cd00ca9a171c10f37fc75b3ad49e to your computer and use it in GitHub Desktop.
Save CodeZombie/1dd9cd00ca9a171c10f37fc75b3ad49e to your computer and use it in GitHub Desktop.
version: '2.0'
services:
db:
image: mariadb:10.5
container_name: seafile-mysql
environment:
- MYSQL_ROOT_PASSWORD=db_dev # Requested, set the root's password of MySQL service.
- MYSQL_LOG_CONSOLE=true
volumes:
- /mnt/twotera/seafile-mysql/db:/var/lib/mysql # Requested, specifies the path to MySQL data persistent store.
networks:
- seafile-net
memcached:
image: memcached:1.6
container_name: seafile-memcached
entrypoint: memcached -m 256
networks:
- seafile-net
seafile:
image: seafileltd/seafile-mc:latest
container_name: seafile
ports:
- "6901:80"
# - "443:443" # If https is enabled, cancel the comment.
volumes:
- /mnt/twotera/seafile-data:/shared # Requested, specifies the path to Seafile data persistent store.
environment:
- DB_HOST=db
- DB_ROOT_PASSWD=db_dev # Requested, the value shuold be root's password of MySQL service.
- TIME_ZONE=Etc/UTC # Optional, default is UTC. Should be uncomment and set to your local time zone.
- [email protected] # Specifies Seafile admin user, default is '[email protected]'.
- SEAFILE_ADMIN_PASSWORD=mypassword # Specifies Seafile admin password, default is 'asecret'.
- SEAFILE_SERVER_LETSENCRYPT=false # Whether to use https or not.
- SEAFILE_SERVER_HOSTNAME=hambox.home:6901 # Specifies your host name if https is enabled.
depends_on:
- db
- memcached
networks:
- seafile-net
networks:
seafile-net:
Because the Bell HomeHub4000 is an enormous piece of shit and doesn't allow you to run a custom DNS server locally,
we have to abuse 301 re-routing to use nameservers.
The Homehub will assign "<hostname>.home" domain names to all devices on a local network if you have "Custom DNS" enabled and set to anything (8.8.8.8 8.8.4.4, etc)
This will not allow subdomains unfortunately, so we're going to use routes by getting nginx to return 301s on all "myserver.home/<route>" requests to services on the appropriate ip address.
# bash into your docker container:
sudo docker exec -it seafile bash
# Restart your docker container:
sudo docker-compose down
sudo docker-compose up -d
# how to fully nuke the seafile server:
sudo docker-compose down
then delete the /mnt/... files created by the docker container.
https://docs.tibco.com/pub/mash-local/4.3.0/doc/html/docker/GUID-BD850566-5B79-4915-987E-430FC38DAAE4.html
Important docs:
https://manual.seafile.com/docker/deploy_seafile_with_docker/
server {
listen 80;
server_name hambox.home;
proxy_set_header X-Forwarded-For $remote_addr;
location /seafile {
return 301 $scheme://hambox.home:6901;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment