-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |