-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Add a docker compose file #70
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is good practise to have the docker-compose version stated at the top of the file, for compatibility with GUIs like portainer one might want to stick to
version: '2.1'
Also, should add a volume declaration
volumes:
protonmail:
name: protonmail
I also added an external network to my file so that I can add other containers to the same docker network and not expose the ports on the host, especially useful on servers with public IPs, however this might be a commented section in the file by default.
@eyduh I am not entirely following the volume declaration.
|
For the containers, or services as they technically are referred to in a compose file, there can be a section declaring where to store user data. This can either be a named volume, like
In which case the volume will need to be declared in a Another way to store user data is using bind mounts like you have declared in your example. If using bind mounts then you do not need to declare a volume separately. There are also predefined volumes that get declared in the Dockerfile if one knows that a certain directory will contain data that needs to be persisted for the user. You can read more about the different ways to persist user data here.. It is technically not needed but if one wants to move this container from one host to another using volumes is one way to do it, also to make sure the setup is persisted between updates or rebuilds of the image and container. Seeing as there is no need to browse the files of this container, and the user files are a bit sensitive to permissions, I used a docker volume rather than a bind mount for my setup. The service is run as root so the gpg key files are generated in /root in this case so persisting /root in a docker volume made sense to me, but there is no one right way to do things c: |
Thank for the very detailed answer @eyduh! How would one initialize the container with compose? If I initiate using |
@hobbes444 by default volumes:
protonmail:
external: true |
Thanks @Nexion @eyduh . I did this: docker run --rm -it -v protonmail:/root shenxn/protonmail-bridge init then version: '2.1'
services:
protonmail-bridge:
image: shenxn/protonmail-bridge
container_name: pm_bridge
ports:
- 127.0.0.1:1025:25/tcp
- 127.0.0.1:1143:143/tcp
restart: unless-stopped
stdin_open: true
tty: true
volumes:
protonmail:
external: true but that does not seem to work, I get this error:
It seems it's not able to find the data created using the initialization command. |
@hobbes444 version: '2.1'
services:
protonmail-bridge:
image: shenxn/protonmail-bridge
container_name: pm_bridge
ports:
- 127.0.0.1:1025:25/tcp
- 127.0.0.1:1143:143/tcp
volumes: # <---
- protonmail:/root
restart: unless-stopped
stdin_open: true
tty: true
volumes:
protonmail:
external: true |
Thanks for the contribution! Sorry for replying late. I'll merge this first and feel free to submit any further improvements |
* Bump build version to 3.0.10 * Bump build version to 3.0.12 * Bump build version to 3.0.14 * Bump build version to 3.0.15 * Bump build version to 3.0.16 * Bump deb version to 3.0.17-1 * Bump build version to 3.0.18 * Bump deb version to 3.0.19-1 * Bump build version to 3.0.19 * Bump deb version to 3.0.20-1 * Bump build version to 3.0.20 * Update Ubuntu tag for deb to fix GLIBC dependency (shenxn#80) GLIBC dependency issue highlighted in shenxn#79 is caused by v3 of the bridge not supporting bionic. This PR simply updates the "deb" version to match the "build" version which is already on ubuntu:jammy. * Bump deb version to 3.0.21-1 * Bump build version to 3.0.21 * Bump build version to 3.1.0 * Bump build version to 3.1.1 * Bump deb version to 3.1.2-1 * Bump build version to 3.1.2 * Add a docker compose file (shenxn#70) It's quite the norm to include a docker-compose file, generally in the README or the root for people to copy and modify. For example as https://github.com/wfg/docker-openvpn-client has done so. If there are [Environmental variables](https://github.com/wfg/docker-openvpn-client#environment-variables), they should also be documented - in this case there isn't. * Bump deb version to 3.1.3-1 * Bump build version to 3.1.3 * Bump build version to 3.2.0 * Bump deb version to 3.2.0-1 * Bump build version to 3.3.0 * Bump deb version to 3.3.0-1 * Bump build version to 3.3.1 * Bump deb version to 3.3.2-1 * Bump build version to 3.3.2 * Bump build version to 3.4.0 * Bump build version to 3.4.1 * Bump build version to 3.4.2 * Bump build version to 3.5.0 * Bump deb version to 3.4.2-1 * Bump build version to 3.5.1 * Bump deb version to 3.5.1-1 * Bump deb version to 3.4.2-1 * Bump build version to 3.5.2 * Bump deb version to 3.5.3-1 * Bump build version to 3.5.3 * Bump build version to 3.6.0 * Bump deb version to 3.5.4-1 * Bump build version to 3.6.1 * Bump deb version to 3.6.1-2 * Bump build version to 3.7.0 * Bump build version to 3.7.1 * Bump deb version to 3.7.1-1 * Bump build version to 3.8.0 * Bump build version to 3.8.1 * Bump deb version to 3.8.1-1 * Bump build version to 3.9.0 * Bump deb version to 3.8.2-1 --------- Co-authored-by: GitHub Actions <[email protected]> Co-authored-by: Aziz Hasanain <[email protected]> Co-authored-by: Daniel Nathan Gray <[email protected]>
* Bump build version to 3.0.10 * Bump build version to 3.0.12 * Bump build version to 3.0.14 * Bump build version to 3.0.15 * Bump build version to 3.0.16 * Bump deb version to 3.0.17-1 * Bump build version to 3.0.18 * Bump deb version to 3.0.19-1 * Bump build version to 3.0.19 * Bump deb version to 3.0.20-1 * Bump build version to 3.0.20 * Update Ubuntu tag for deb to fix GLIBC dependency (shenxn#80) GLIBC dependency issue highlighted in shenxn#79 is caused by v3 of the bridge not supporting bionic. This PR simply updates the "deb" version to match the "build" version which is already on ubuntu:jammy. * Bump deb version to 3.0.21-1 * Bump build version to 3.0.21 * Bump build version to 3.1.0 * Bump build version to 3.1.1 * Bump deb version to 3.1.2-1 * Bump build version to 3.1.2 * Add a docker compose file (shenxn#70) It's quite the norm to include a docker-compose file, generally in the README or the root for people to copy and modify. For example as https://github.com/wfg/docker-openvpn-client has done so. If there are [Environmental variables](https://github.com/wfg/docker-openvpn-client#environment-variables), they should also be documented - in this case there isn't. * Bump deb version to 3.1.3-1 * Bump build version to 3.1.3 * Bump build version to 3.2.0 * Bump deb version to 3.2.0-1 * Bump build version to 3.3.0 * Bump deb version to 3.3.0-1 * Bump build version to 3.3.1 * Bump deb version to 3.3.2-1 * Bump build version to 3.3.2 * Bump build version to 3.4.0 * Bump build version to 3.4.1 * Bump build version to 3.4.2 * Bump build version to 3.5.0 * Bump deb version to 3.4.2-1 * Bump build version to 3.5.1 * Bump deb version to 3.5.1-1 * Bump deb version to 3.4.2-1 * Bump build version to 3.5.2 * Bump deb version to 3.5.3-1 * Bump build version to 3.5.3 * Bump build version to 3.6.0 * Bump deb version to 3.5.4-1 * Bump build version to 3.6.1 * Bump deb version to 3.6.1-2 * Bump build version to 3.7.0 * Bump build version to 3.7.1 * Bump deb version to 3.7.1-1 * Bump build version to 3.8.0 * Bump build version to 3.8.1 * Bump deb version to 3.8.1-1 * Bump build version to 3.9.0 * Bump deb version to 3.8.2-1 --------- Co-authored-by: GitHub Actions <[email protected]> Co-authored-by: Aziz Hasanain <[email protected]> Co-authored-by: Daniel Nathan Gray <[email protected]>
It's quite the norm to include a docker-compose file, generally in the README or the root for people to copy and modify. For example as https://github.com/wfg/docker-openvpn-client has done so.
If there are Environmental variables, they should also be documented - in this case there isn't.