abiosoft / caddy-docker

Docker container for Caddy
https://hub.docker.com/r/abiosoft/caddy/
MIT License
768 stars 315 forks source link

managed to get into the docker instance. thanks but it doesnt seem to autorun. #184

Closed hiqbn closed 5 years ago

hiqbn commented 5 years ago

i'm inside the container by doing docker exec -it caddy /bin/sh there's no process inside.

what command should i type for it to run?

abiosoft commented 5 years ago

What command are you using to start the container?

I'll be closing this as it is not an issue with Caddy or the image. However, the discussion can continue.

hiqbn commented 5 years ago

docker run -it -e CLOUDFLARE_EMAIL=email -e CLOUDFLARE_API_KEY=12345678 -h caddy --name caddy -p 2015:2015 -p 443:443 -v $(pwd)/Caddyfile:/etc/Caddyfile abiosoft/caddy:builder /bin/sh

i have no idea why it doesnt autorun but i'm inside the container. pls inform how to run the caddy process inside as once inside, there are no processes other than 2 system process of linux

Can you also please mention the memory requirement suggested for running caddy? Because 512mb cloud instance is not sufficient to compile go build for plugins etc. that's all. I did the virtual memory for it to be able to compile etc but what's the suggested memory requirement for it. Do put inside the front page or wiki etc. thx.

abiosoft commented 5 years ago

abiosoft/caddy:builder is for generating caddy binaries. abiosoft/caddy (or your custom image) is what you should run.

hiqbn commented 5 years ago

when i ran the abiosoft/caddy, it says Unknown DNS provider by name 'cloudflare' error. I've managed to generate the image

REPOSITORY TAG IMAGE ID CREATED SIZE

b0b3e97b2343 18 hours ago 466MB abiosoft/caddy latest 2a1f4da4f9a6 2 weeks ago 46.3MB abiosoft/caddy builder d13c525ed8b9 2 weeks ago 464MB how do i run this?
abiosoft commented 5 years ago

Use the image tag b0b3e97b2343. You could've used docker build -t custom_tag to have a custom tag.

docker run -it -e CLOUDFLARE_EMAIL=email -e CLOUDFLARE_API_KEY=12345678 -h caddy --name caddy -p 2015:2015 -p 443:443 -v $(pwd)/Caddyfile:/etc/Caddyfile b0b3e97b2343
hiqbn commented 5 years ago

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2895f104c1a9 b0b3 "/bin/sh /usr/bin/bu…" About a minute ago Exited (1) 1 second ago caddy

it will never be started with docker start caddy

i did however did the /bin/sh at the end of the container above and can ssh into it BUT like i said, there's no default running processes inside. how do i run it?

this is how it looks from "top" inside the container

Mem: 411824K used, 79620K free, 168K shrd, 22900K buff, 211676K cached CPU: 0% usr 0% sys 0% nic 99% idle 0% io 0% irq 0% sirq Load average: 0.21 0.43 0.21 2/180 14 PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND 1 0 root S 1596 0% 0 0% /bin/sh 13 1 root R 1532 0% 0 0% top

hv tried to run it for the past week.

hiqbn commented 5 years ago

any feedback on this?

hiqbn commented 5 years ago

can you pls help?

abiosoft commented 5 years ago

There are issues with some plugins (including cloudflare) at the moment. It is not building with Caddy 1.0 due to go modules requirement.

You can follow the following steps to get Caddy running.

plugins=git,cors # you can have other plugins, just comma separate them
docker build --build-arg plugins=$plugin -t mycaddy github.com/abiosoft/caddy-docker.git
docker run -it --rm --name caddy -p 2015:2015 -p 443:443 -v $(pwd)/Caddyfile:/etc/Caddyfile mycaddy

It that is not successful, you can check what went wrong with docker logs -f mycaddy.

hiqbn commented 5 years ago

can u provide the code for cloudflare only for me to test? the instructions for setting up cloudflare