ProjectSend as Docker
March 3, 2024
The projectsend page at LinuxServer.io is great but missing something… like the database config. You CAN stand up a database for this and other services but wanting my docker compose files to create complete working applications, I’m happy to spend the memory and CPU on yet another database instance just for this docker container. There’s a trick to getting this working but it’s an easy trick (I figured it out myself after all)
First I added a database to the docker compose file. I chose to do this with a dedicated database to simplify and keep all docker compose files in my setup “complete”. Each one will run a working application. At least that’s true for now. I may change my mind but for ease of use and recovery this makes sense to me.
I’ve also added a bunch of Traefik labels (since that’s my gateway into my systems) which will make this an https application. You’ll note that the app runs on port 80, but traefik is taking care of the SSL cert and therefore managing the encryption. The problem with this is, the servers base URL is https://shares.yourdomain.com and not http:// which is assumed in the initial setup. This also assumes you have traefik up and working and configured correctly (which is beyond the scope of this article) and that you have a docker network configured called ‘web’ and you know why you would do that… again beyond the scope of this article.
So, when you run the install you have to ensure a couple of things, that you connect to the database server correctly: use the name of the database container (in my case that will be ‘mariadb-projectsend’) and you have to ensure the base URL starts with https (if you don’t do this you’ll end up with a mess as all images and style sheets won’t be pulled correctly).
One last thing, when configuring the thing to send email, use a gmail account. It’s annoying but it works perfectly and won’t give you any trouble. I tried a couple of options but they weren’t in my control .
Settings for gmail:
host: smtp.gmail.com
username: yourgmailaddress@gmail.com
pasword: use an app password (google this to figure out how to obtain and use an app password)
port 587
TLS
A complete and working docker-compose.yml
version: '3'
services:
projectsend:
image: linuxserver/projectsend
container_name: projectsend
environment:
- PUID=998
- PGID=100
- TZ=Etc/UTC
- MAX_UPLOAD=5000
volumes:
- ./config:/config #Config Volume Goes Here
- ./data:/data #File Storage Volume Goes Here
ports:
- 8010:80
networks:
- web
restart: unless-stopped
labels:
- traefik.enable=true
- traefik.http.routers.projectsend.rule=Host(`shares.yourdomain.com`)
- traefik.http.routers.projectsend.service=projectsend
- traefik.http.routers.projectsend.entrypoints=websecure
- traefik.http.services.projectsend.loadbalancer.server.port=80
- traefik.http.routers.projectsend.tls=true
- traefik.http.routers.projectsend.tls.certresolver=myresolver
- traefik.docker.network=web
db:
image: mariadb
container_name: mariadb-projectsend
environment:
- MYSQL_ROOT_PASSWORD=CoolPasswordHere
- MYSQL_DATABASE=projectsend
- MYSQL_USER=projectsend-user
- MYSQL_PASSWORD=anotherCoolPasswordHere
- TZ=Etc/UTC
volumes:
- ./mariadb:/var/lib/mysql #Database Volume Goes Here
networks:
- web
restart: unless-stopped
networks:
web:
external: true
PS: discovered that you can enhance your brand by fudging with the favicon settings in the headers… If you upload an icon file to /<dockerstuff>/projectsend/data/projectsend/thumbnails/
this is available through the interface at
https://<your domain>/upload/thumbnails/<your icon filename>.ico
if you then add the following
<link rel="apple-touch-icon" sizes="180x180" href="https://<yourdomain>/assets/img/favicon/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="https://<yourdomain>/upload/thumbnails/<your logo filename>.ico"><link rel="icon" type="image/png" sizes="16x16" href="https://<yourdomain>/upload/thumbnails/<your logo filename>.ico"><link rel="manifest" href="https://<yourdomain>/assets/img/favicon/site.webmanifest"><meta name="theme-color" content="#4c2ab6">
as an HTML asset and locate it as a header element in all locations except file template, it seems to just work.