There's literally compose files in the link you provided. Copy/paste?
Selfhosted
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
Rules:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
Well, what issue do you have? You have a docker-compose snippet that you can add with portainer, from there what is not working?
Well, I added in the docker-compose snippet in the "Running" section of the link to a new stack in Portainer, changing secret_key and allowed_hosts to localhost, pre-setup the volumes on Synology. The first error I get is "services.api.environment must be a mapping"
Lol, the snippet has a mistake. The environment section should look like one of the 2 ways shown there: https://docs.docker.com/compose/compose-file/compose-file-v3/#environment
So either
environment:
- SECRET_KEY=
- ALLOWED_HOSTS=
Or
environment:
SECRET_KEY:
ALLOWED_HOSTS:
Well, with "- SECRET_KEY=" I at least got a different error, a bind mount fail?
I see what's the problem this time, in your case you should probably use named volumes instead of bind-mount (which us what it is trying to do). I'm going to sleep now but if you can't figure it out I can send an example tommorow.
Not sure on the terms, but I did change the volume lines to direct to folders I pre-made in /volume1/drink-stash/data (same for public)
Try this:
version: '3.7'
services:
api:
image: 'gthole/drink-stash:latest'
init: true
restart: 'always'
environment:
- SECRET_KEY=YOUR_SECRET_KEY
- ALLOWED_HOSTS=SYNOLOGY_HOSTNAME_OR_IP
ports:
- 8081:8000
volumes:
- drink-stash-data:/data
- drink-stash-public:/public
volumes:
drink-stash-data:
drink-stash-public:
This will create volumes instead of mounting the folders. Mounting the folders (which is what you tried doing before) should be possible and nicer to use since you would be able to navigate the files directly, but since I do not know the filesystem and layout of synology it's harder for me to help there. Using named volumes like I just sent you should work for any filesystem/layout so you shouldnt have any problem with that.
Also, use the synology hostname and/or ip for the allowed_hosts, localhost would only work if you were running that on your computer. The app should then be available at http://SYNOLOGY_HOSTNAME_OR_IP:8081
Well that did allow the Portainer to compile without error and deploy so I really appreciate the help! When navigating to the http://(my ip):8081 though I get a white page with "Bad Request (400)" on it
Hard to say, any logs?
Hmm, no errors popped up and the container is running. In the Container Manager details it shows the port 8081, so not sure...I'll try to troubleshoot some more, but I really appreciate you taking the time!
Finally got it to work! Thanks for your help, I took another stab at it after a few weeks of learning other things and it clicked
For anyone trying to google a solution, I got it to work with the below in Portainer
version: '3.7'
services:
api:
image: 'gthole/drink-stash:latest'
init: true
restart: 'always'
environment:
- SECRET_KEY=*enter-a-key-here*
- ALLOWED_HOSTS=*enter-ip-here*
- DJANGO_SUPERUSER_USERNAME=*can-be-whatever*
- DJANGO_SUPERUSER_EMAIL=*duh*
- DJANGO_SUPERUSER_PASSWORD=*make-it-up*
- DJANGO_SUPERUSER_FIRST_NAME=*John*
- DJANGO_SUPERUSER_LAST_NAME=*Smith*
- INITIAL_FIXTURES=recipes
ports:
- 8081:8000
volumes:
- /volume1/docker/drink-stash/data:/data
- /volume1/docker/drink-stash/public:/public