Skip to content

Commit

Permalink
Update docker description
Browse files Browse the repository at this point in the history
  • Loading branch information
tsjensen committed Aug 28, 2023
1 parent 3177cbf commit 2de5e39
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -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
```

0 comments on commit 2de5e39

Please sign in to comment.