OpnForm icon indicating copy to clipboard operation
OpnForm copied to clipboard

Docker and Docker compose

Open userbradley opened this issue 2 years ago • 2 comments

Hey!

Would be awesome to have a Dockerfile and a docker-compose.yml

I know you're still writing the guide on self hosting, but thought I would show interest in a docker setup!

userbradley avatar Dec 28 '22 23:12 userbradley

Hey Bradley, that's definitely planned! Unfortunately, I have close to zero docker experience. I started to look at it with @cellerich but with the holidays we put this aside for a bit. Would you be available to help with it as well? Thanks!

JhumanJ avatar Dec 29 '22 10:12 JhumanJ

Woo! Certainly happy to help!

If you have 18 minutes and 19 seconds to kill, this is the Youtube Video I learnt docker files from!

Happy to give you pointers along the way etc!

If you can get the install on ubuntu or similar OS instructions done I can take a stab at a dockerfile!

userbradley avatar Dec 29 '22 13:12 userbradley

I got this working with Docker, I'd be happy to share by dockerfile if anyone's interested. (I actually have 2, the first being a local dev and the 2nd being hosted on one of my servers.

A few issues I ran into are related to mixed content which I did find a workaround for but I'm wondering if there might be a better solution as my fix doesn't seem to fully solve the problem.

Let me know if you want me to share my docker setup

netsolid-ca avatar Feb 21 '23 14:02 netsolid-ca

@netsolid-ca

Let me know if you want me to share my docker setup

Would love to see your approach!

cellerich avatar Feb 21 '23 14:02 cellerich

docker-setup.zip

Attached are my 2 setups, staging is going up to my gitlab-runner, the other files are for my locally hosted environment.

I should mention that after starting the machine you'll need to attach to the console (docker exec -it /bin/bash) so you can run composer update and npm install.

Finally, with my staging environment I had to add the following line to spa.blade.php in order to resolve the mixed-content message. (All other methods I attempted didn't work. I believe this is because I use traefik for SSL.)

netsolid-ca avatar Feb 21 '23 14:02 netsolid-ca

@netsolid-ca Thanks for sharing. I will look into it later this week. Instead of starting the machine and run 'composer update' and 'npm install' you might also look into a "multistage docker build". I found this article useful: Multistage Docker Build

cellerich avatar Feb 21 '23 16:02 cellerich

Hey, thanks for sharing your different setup. I've just merged https://github.com/JhumanJ/OpnForm/pull/73 by @philipgatzka, which is a great first step. I'm gonna close this issue for now, please feel free to re-open one or to use discussions.

JhumanJ avatar Feb 22 '23 18:02 JhumanJ