From 9d2bf07c78142a0211dbec29f8424f162c23f9b1 Mon Sep 17 00:00:00 2001 From: Mark Monteiro Date: Wed, 7 Feb 2024 22:06:43 -0500 Subject: [PATCH] Improve Docker Compose documentation and example (#95) - Clean up the example `docker-compose.yml` file by removing unnecessary configuration/comments and add missing volume declaration - Update the project README.md with instructions on how to use the project with Docker Compose --- README.md | 14 +++++++++++++- docker-compose.yml | 8 ++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0c048b3..e772fde 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,13 @@ To initialize and add account to the bridge, run the following command. docker run --rm -it -v protonmail:/root shenxn/protonmail-bridge init ``` -Wait for the bridge to startup, use `login` command and follow the instructions to add your account into the bridge. Then use `info` to see the configuration information (username and password). After that, use `exit` to exit the bridge. You may need `CTRL+C` to exit the docker entirely. +If you want to use Docker Compose instead, you can create a copy of the provided example [docker-compose.yml](docker-compose.yml) file, modify it to suit your needs, and then run the following command: + +``` +docker compose run protonmail-bridge init +``` + +Wait for the bridge to startup, then you will see a prompt appear for [Proton Mail Bridge interactive shell](https://proton.me/support/bridge-cli-guide). Use the `login` command and follow the instructions to add your account into the bridge. Then use `info` to see the configuration information (username and password). After that, use `exit` to exit the bridge. You may need `CTRL+C` to exit the docker entirely. ## Run @@ -47,6 +53,12 @@ To run the container, use the following command. docker run -d --name=protonmail-bridge -v protonmail:/root -p 1025:25/tcp -p 1143:143/tcp --restart=unless-stopped shenxn/protonmail-bridge ``` +Or, if using Docker Compose, use the following command. + +``` +docker compose up -d +``` + ## Kubernetes If you want to run this image in a Kubernetes environment. You can use the [Helm](https://helm.sh/) chart (https://github.com/k8s-at-home/charts/tree/master/charts/stable/protonmail-bridge) created by [@Eagleman7](https://github.com/Eagleman7). More details can be found in [#23](https://github.com/shenxn/protonmail-bridge-docker/issues/23). diff --git a/docker-compose.yml b/docker-compose.yml index cdea9b5..fa91e7d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,16 +3,12 @@ version: '2.1' services: protonmail-bridge: image: shenxn/protonmail-bridge - # build: - # context: ./build - # dockerfile: Dockerfile - container_name: pm_bridge ports: - 1025:25/tcp - 1143:143/tcp restart: unless-stopped - stdin_open: true - tty: true + volumes: + - protonmail:/root volumes: protonmail: name: protonmail