From aa9246da4ec9b50c5d3f0a412ec44516c8475519 Mon Sep 17 00:00:00 2001 From: Arie Date: Mon, 27 Jun 2022 10:37:25 +1000 Subject: [PATCH 1/3] Removes COPY instruction for static directory --- Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 28be727..9f8858e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,8 +19,5 @@ WORKDIR /usr/local/bin # copy built exacutable COPY --from=builder /usr/src/microbin/target/release/microbin /usr/local/bin/microbin -# copy /static folder containing the stylesheets -COPY --from=builder /usr/src/microbin/static /usr/local/bin/static - # run the binary -CMD ["microbin"] \ No newline at end of file +CMD ["microbin"] From 0d43f2f60a7250971b352228c738afab8c8e89d6 Mon Sep 17 00:00:00 2001 From: Arie Date: Mon, 27 Jun 2022 10:39:32 +1000 Subject: [PATCH 2/3] Updates README with docker build instructions --- README.MD | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.MD b/README.MD index 590eab3..c0d13de 100644 --- a/README.MD +++ b/README.MD @@ -118,6 +118,42 @@ cargo build --release ./target/release/microbin -p 80 ``` +### Building Docker Image + +MicroBin includes a Dockerfile. To build the image, follow these steps: + +``` +git clone https://github.com/szabodanika/microbin.git +cd microbin +docker build -t microbin-docker . +``` + +Then, for `docker compose` you can do the following: + +``` +services: + paste: + image: microbin-docker + restart: always + ports: + - "80:8080" + volumes: + - ./microbin-data:./pasta_data +``` + +**Note:** If you are getting the following error about domain name resolution: + +``` +warning: spurious network error (2 tries remaining): failed to resolve address for github.com: Temporary failure in name resolution; class=Net (12) +warning: spurious network error (1 tries remaining): failed to resolve address for github.com: Temporary failure in name resolution; class=Net (12) +``` + +You might need to run `docker build` with the `--network` option: + +``` +docker build --network host -t microbin-docker . +``` + ### MicroBin as a service To install it as a service on your Linux machine, create a file called `/etc/systemd/system/microbin.service`, paste this into it with the `[username]` and `[path to installation directory]` replaced with the actual values. If you installed MicroBin from cargo, your executable will be in your cargo directory, e.g. `/Users/daniel/.cargo/bin/microbin`. From f5b9036a2a3a588f80cdc858ef6e25563db038cc Mon Sep 17 00:00:00 2001 From: Arie Date: Mon, 27 Jun 2022 10:52:37 +1000 Subject: [PATCH 3/3] Uses volume absolute path, changes wording --- README.MD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.MD b/README.MD index c0d13de..d9ea214 100644 --- a/README.MD +++ b/README.MD @@ -128,7 +128,7 @@ cd microbin docker build -t microbin-docker . ``` -Then, for `docker compose` you can do the following: +Then, for `docker compose` you can repurpose the following example in your compose file: ``` services: @@ -138,7 +138,7 @@ services: ports: - "80:8080" volumes: - - ./microbin-data:./pasta_data + - ./microbin-data:/usr/local/bin/pasta_data ``` **Note:** If you are getting the following error about domain name resolution: