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

Dockerfile #49

Closed
abate opened this issue Feb 27, 2019 · 4 comments
Closed

Dockerfile #49

abate opened this issue Feb 27, 2019 · 4 comments

Comments

@abate
Copy link

abate commented Feb 27, 2019

Thank you for this project ! I really don't think to use the proprietary bridge from protonmail.

Since hydroxide is meant to run headless, I think it makes sense to have a small dockerfile for
it and run it in a separate container. Below, there is a simple example to build and create such container.

To make it usable I need a few more information.

  • For carddav, do I still need a reverse proxy or I can connect directly to the port offered by hydroxide
    ?
  • Where the configuration files are stored ? Docker can bind mount a directory (ex. ~/.hydroxide) or create a docker volume to store all the configuration file and persistent data.
  • At the moment if I want smtp, imap and carddav, I need to launch three process. Maybe you can change the command line to select which services should be available and then fork three threads ? Something like :
> docker run hydroxide carddav smtp
2019/02/27 08:28:27 Starting CardDAV server at 127.0.0.1:8080
2019/02/27 08:25:33 Starting SMTP server at 127.0.0.1:1025

Otherwise to containerize hydroxide I need to add a process manager that defeats a bit the philosophy of one process per container ...

Once you have docker installed on your machine and saved the snipped below as Dockerfile , it's just as simple as docker build . -t hydroxide and docker run hydroxide

FROM golang:1-alpine as builder
  
RUN apk --update upgrade \
&& apk --no-cache --no-progress add git make gcc musl-dev \
&& rm -rf /var/cache/apk/*

RUN go get github.com/emersion/hydroxide/cmd/hydroxide

FROM alpine:3.9
RUN apk --update upgrade \
    && apk --no-cache --no-progress add ca-certificates git \
    && rm -rf /var/cache/apk/*

EXPOSE 1025
EXPOSE 1143
EXPOSE 8080

COPY --from=builder /go/bin/hydroxide /usr/bin/hydroxide

ENTRYPOINT ["/usr/bin/hydroxide"]

And one last question : this is me not understanding... when I do hydroxide auth <username> which username is that ? protonmail ? Or a local username used to store all the protonmail data separate from others ?

@emersion
Copy link
Owner

For carddav, do I still need a reverse proxy or I can connect directly to the port offered by hydroxide
?

You can connect directly but only locally as it's not HTTPS.

Where the configuration files are stored?

As of the latest release, $XDG_CONFIG_HOME/hydroxide (if not set, $HOME/.config/hydroxide).

At the moment if I want smtp, imap and carddav, I need to launch three process. Maybe you can change the command line to select which services should be available and then fork three threads ?

Yes. Launching 3 processes won't work well (at least if you run both IMAP and CardDAV, SMTP and another server might work better). I definitely want to add this feature: #21

when I do hydroxide auth which username is that ? protonmail ? Or a local username used to store all the protonmail data separate from others ?

Added some README instructions about this.

@harleylang
Copy link
Contributor

@abate did you ever publish your dockerfile?

@emersion would you prefer a pull request or keeping a dockerfile in a separate repo?

@emersion
Copy link
Owner

would you prefer a pull request or keeping a dockerfile in a separate repo?

I'd prefer if the Dockerfile was community-maintained, out-of-tree.

@harleylang
Copy link
Contributor

@emersion cool, I've set up some example configurations here: https://github.com/harleylang/hydroxide-docker

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

No branches or pull requests

3 participants