app icon indicating copy to clipboard operation
app copied to clipboard

add docker-compose

Open doanguyen opened this issue 3 years ago • 18 comments

Todo:

  • [x] Have functioning docker stacks
  • [x] Think about how to handle environment variables in swarm
  • [x] Do we need a dedicated repository to put all the configurations/workflows?
  • [x] ~~Write a tutorial~~
  • [x] Should we override the Nginx (other available docker images)? -- No, we add 1 more server block
  • [x] ~~Having an official postfix docker image~~
  • [x] ~~Having a job runner image?~~

Summary:

The PR is not a completed solution but can be used as a first step to reach the goal

doanguyen avatar Dec 29 '20 11:12 doanguyen

If it can be of any use for help: https://github.com/Metabaron1/app/blob/metabaron1/master/docker-compose.yml

Metabaron1 avatar Dec 29 '20 21:12 Metabaron1

@Metabaron1 Thanks a lot, I will definitely check that out.

doanguyen avatar Dec 30 '20 09:12 doanguyen

what is stopping this PR ? im setting up Simple login on a new server and i am going to test it out

FarisZR avatar May 01 '21 21:05 FarisZR

@fareszr I guess @doanguyen doesn't have much time at the moment ...

@doanguyen please let me know if you want someone to continue working on this PR :).

nguyenkims avatar May 02 '21 18:05 nguyenkims

this looks like it still needs manual db initialization

i think you can create a simple python script to check if the db is empty, and if its initiate it

FarisZR avatar May 04 '21 19:05 FarisZR

@fareszr I guess @doanguyen doesn't have much time at the moment ...

@doanguyen please let me know if you want someone to continue working on this PR :).

sorry for the delay. I'm trying to finalize this PR at the end of the week.

doanguyen avatar May 05 '21 09:05 doanguyen

i tried using the PR in my re-setup for simplelogin,

unfortunately nothing worked

the entrypoint files always gave permission denied errors, (maybe because i am using the official image as a base instead of building from source ?) i have postfix setup externally as i need it for other services, so i didn't test the sl-specifc image same thing with caddy, i have nginx proxy manager already setup.

i just ended up using the same method in #309

FarisZR avatar May 13 '21 02:05 FarisZR

@fareszr thanks for testing out this PR! This PR isn't in a stable status at the moment, hope we can get back working on it soon!

nguyenkims avatar May 13 '21 08:05 nguyenkims

Sorry but how about the progress of this PR? Thank you.

quyleanh avatar Apr 07 '22 08:04 quyleanh

@quyleanh we haven't had a chance to continue working on this PR yet.

nguyenkims avatar Apr 07 '22 08:04 nguyenkims

@quyleanh we haven't had a chance to continue working on this PR yet.

I'd love to self-host simple-login, and I've been patiently waiting for an official procedure through a single docker-compose for quite some time.

Question: is this something that has some kind of internal priority or not? If not, it would be better to know this so users interested in official (and supported) procedures could explore alternative solutions. It would be a pity because I'd love to use SL in my homelab.

Thanks for your work and I hope to hear good news about this. :)

alexdelprete avatar Apr 24 '23 16:04 alexdelprete

@alexdelprete Hi internally we don't use docker compose to run SimpleLogin so docker compose stack is rather maintained by the community.

nguyenkims avatar Apr 25 '23 08:04 nguyenkims

docker compose stack is rather maintained by the community.

Hi. I thought this PR was being developed by SL team, sorry if I misunderstood.

I guess I'll have to revert to https://github.com/anonaddy/docker.

Thanks for answering.

alexdelprete avatar Apr 25 '23 16:04 alexdelprete

@quyleanh we haven't had a chance to continue working on this PR yet.

I'd love to self-host simple-login, and I've been patiently waiting for an official procedure through a single docker-compose for quite some time.

@alexdelprete for what it’s worth, I’m currently working on a simple docker-compose configuration for self-hosting SimpleLogin.

I’m currently using it "in production" for my circle of friends. I started with the original documentation for setting up SimpleLogin and am gradually morphing that into a docker-compose setup.

The current state is:

  • Identical installation as the original documentation suggests.
    • it uses a single environment file for all the setup.
    • it supports migrations. e.g see 4.6.2-beta migration.

Next updates will be to:

  • Include postfix as a Docker image (although the official SimpleLogin postfix image does too much in my opinion)
  • Include nginx as a Docker image

My self-host does not rely on Certbot and LetsEncrypt but instead relies and acme.sh and ZeroSSL that has a better integration with my DNS provider for wildcard certificates. Therefore, the next steps after that would be to supports one or the other.

springcomp avatar Jul 24 '23 15:07 springcomp

@alexdelprete for what it’s worth, I’m currently working on a simple docker-compose configuration for self-hosting SimpleLogin.

FYI, I have updated my repository and I’m quite satisfied with the setup:

  • Postfix still runs bare-metal.
  • Everything else works in Docker containers

Once you have configured DNS with complete exhaustive instructions, you can start the stack and it will:

  • Automatically issue SSL certificates the first time it runs.
  • Initialize the database and database schema.

On subsequent restarts, it handles:

  • Renewing SSL certificates periodically.
  • Updating the database schema using migrations.

My current setup uses ZeroSSL and acme.sh to issue and renew wildcard certificates using my DNS provider in order to support subdomains. It supports using ACME challenge out of the box as well if that is require.

springcomp avatar Sep 22 '23 09:09 springcomp

My current setup uses ZeroSSL and acme.sh to issue and renew wildcard certificates using my DNS provider in order to support subdomains. It supports using ACME challenge out of the box as well if that is require.

Thanks for your work. My homelab relies entirely on Traefik+Cloudflared. So I only need SimpleLogin + Postfix, all the rest is already functionally in production through other services. So I'll wait for your contribution and then will probably use a subset of your docker-compose configuration.

Thanks again for sharing it.

alexdelprete avatar Sep 23 '23 14:09 alexdelprete

[…] So I'll wait for your contribution and then will probably use a subset of your docker-compose configuration. Thanks again for sharing it.

The support for running postfix as a docker container has landed 🍾.

The current setup is very bare bones and does not support much configurations. I probably have to allow support for virtual and aliases but the version I have seems to no longer support btree or hash maps and I’m not entirely familiar with how the new thing works. In any case, the configuration is mounted to the container so it is extensible.

Please, feel free to provide feedback.

springcomp avatar Sep 26 '23 21:09 springcomp

For everyone interested in this feature, I have updated my simple docker-compose file.

It now runs postfix as a docker container and supports wildcard subdomains, virtual aliases and is easily customizable.

I really think this simplifies onboarding and getting started with self-hosting SimpleLogin, while providing reasonable flexibility to accomodate most personal needs without too much of a fuss.

Clone the repo, set .env variables and run! Enjoy!

springcomp avatar Oct 10 '23 14:10 springcomp