Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

actual Dockerfile and config in README #90

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

foxmeyson
Copy link

actual Dockerfile and config in README

README.md Outdated
allow all
deny all # unreachable rule, remaining requests are matched by `allow all` above
}
:80, :443 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this set up auto-redirect from 80 to 443?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this runs the application "Caddy" in Docker on port 80 (for http) and on port 443 (for https), if not, then it cannot serve one of the ports.
You can separate them in the configuration, then you can set a different config for them, but in my cases, the same rules are processed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So :80 is not encrypted, and runs a proxy? That's a security and privacy issue -- we can't have such configuration suggested as a default.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I misunderstood the purpose of this line in the configuration, I corrected it in the commit: 78bd7d8

README.md Show resolved Hide resolved
COPY --from=builder /go/forwardproxy/cmd/caddy/caddy /usr/bin/caddy
EXPOSE 80 443
ENTRYPOINT ["/usr/bin/caddy"]
CMD ["-conf", "/etc/caddy/Caddyfile", "--log", "/dev/stdout", "--agree=true"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where did /etc/caddy/Caddyfile come from?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case is good for Kubernetes - there you can put a config file as Config Map. I can describe a solution for Kubernetes, or put a default config in docker. In any case, it seems to me that it would be good to start the application with a configuration file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will it be more convenient?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently existing gen_caddyfile_and_start.sh script (if it's still functional, haven't touched in a while) generates the config automatically. That seems convenient

WORKDIR /go/forwardproxy/cmd/caddy
RUN go build caddy.go

FROM ubuntu:20.04

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why ubuntu? Why not FROM scratch, isn't the point of using a builder image is to reduce overall image size by shipping only what caddy needs to run?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, however, "Scratch" image gives you an empty file system, That is all it does. scratch on it's own does absolutely nothing, and has nothing in it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants