From 2de5e39fd4672155d8972cf727f89ac9929e952c Mon Sep 17 00:00:00 2001 From: Thomas Jensen Date: Mon, 28 Aug 2023 11:01:35 +0200 Subject: [PATCH] Update docker description --- docker/README.md | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/docker/README.md b/docker/README.md index 7e591ff..1a0bb1e 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,17 +1,36 @@ # docker -This folder contains some supplementary files for setting up a Docker environment on the local machine for building -CivBuddy. It is not part of the CivBuddy app. +This folder contains some supplementary files for setting up a Docker environment for building CivBuddy and trying it +out on a local machine. +It is not part of the CivBuddy app. Prerequisites: 1. [Add SSH keys to GitHub](https://docs.github.com/en/authentication/connecting-to-github-with-ssh) -2. Provide them in /docker/.ssh/ so that they can be included with the container +2. Provide them in docker/.ssh/ so that they can be included with the container In this folder: -- `docker build -t civbuddy-node:8 --progress plain .` -- `docker run --rm -it -vC:\path\to\civbuddy:/build --entrypoint=/bin/bash civbuddy-node:8` -- `cd /build` -- `npm install` -- `npm run build` (or whatever other command) +```shell +docker build -t civbuddy-node:8 --progress plain . +docker run --rm -it -vC:\path\to\civbuddy:/build --entrypoint=/bin/bash civbuddy-node:8 +# The following steps happen inside the build container: +cd /build +npm install +npm run build +``` + +Then, in order to use the app in a local browser: + +``` +docker pull nginx:1-bookworm +docker run -it --rm -d -p 8080:80 --name civbuddy -v C:\path\to\civbuddy\build\dist:/usr/share/nginx/html nginx:1-bookworm +``` + +Now, you can use the app at http://localhost:8080/. + +In order to stop the web server again: + +```shell +docker stop civbuddy +```