Skip to content

Commit

Permalink
Merge pull request #87 from PhlexPlexico/docker-caddy
Browse files Browse the repository at this point in the history
Create Docker Caddy File
  • Loading branch information
PhlexPlexico authored Nov 18, 2021
2 parents fdc5ef5 + 67f7c3f commit 167eea9
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
localhost {
handle {
root * /usr/share/caddy
try_files {path} {path}/ /index.html
file_server
}
}
3 changes: 3 additions & 0 deletions DockerfileLightCaddy
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM caddy:alpine
COPY ./dist /usr/share/caddy
COPY Caddyfile /etc/caddy/Caddyfile
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ Spins up a development server where you can make all your calls, and run it like
This will generate a minified and buildable version of the website in the `dist` folder to use on a web server. In order to use history, you must have a proxy enabled, and reverse proxy enabled for the API calls. There is some setup involved, depending on your flavour of web servers, but some setup configs can be found [here](https://github.com/PhlexPlexico/G5V/wiki).

### Docker Build Instructions:
There are 2 dockerfiles included, ```DockerfileLight``` and ```DockerfileFull```.

There are 3 dockerfiles included, `DockerfileLight`, `DockerfileFull` and `DockerfileLightCaddy`.

#### DockerfileLight:
This should be used if yarn is already installed on your local machine.
Expand All @@ -57,6 +58,17 @@ Now, you can run your application by running ```docker container run --name g5v
G5V requires G5API to be running at `/api`, you can change this behavior run `docker build -t yourname\g5v:latest -f DockerfileFull --build-arg VUE_APP_G5V_API_URL=<your_api_url>` (be sure to include `http(s)://` and not to have a trailing `/`). If you are using Docker Compose refer to [this](https://docs.docker.com/compose/compose-file/compose-file-v3/#args).
Some example setup configs can be found [here](https://github.com/PhlexPlexico/G5V/wiki).

#### DockerfileLightCaddy:
This Docker file should only be used if you wish to run Caddy on the Vue webserver itself. It's rather niche and doesn't offer a lot of difference from NGINX because you will need to run a reverse proxy into this container (that is going to do all the hard lifting). However, if you wish to run everything Caddy you can do so with the following build and run command. Please note there is only a light file included, so yarn will be required to be installed on your host machine and you will need to build the app before running this via `yarn; yarn build`.

To use it, run ```docker build -t yourname\g5v:caddy -f DockerfileLightCaddy .```
Now, you can run your application by running `docker container run --name g5v -p 80:80 yourname\g5v:caddy`

G5V requires G5API to be running at `/api`, you can change this behavior run `docker build -t yourname\g5v:caddy -f DockerfileLightCaddy --build-arg VUE_APP_G5V_API_URL=<your_api_url>` (be sure to include `http(s)://` and not to have a trailing `/`). If you are using Docker Compose refer to [this](https://docs.docker.com/compose/compose-file/compose-file-v3/#args).
Some example setup configs can be found [here](https://github.com/PhlexPlexico/G5V/wiki).

By default with this docker command, Caddy should setup HTTPS by default, and will handle the reverse proxy requests as well.

## Contribution
Sure! If you have a knack for APIs and a penchant for JavaScript, I could always use help! Create a fork of this application, make your changes, and submit a PR. I will be using the [Issues](https://github.com/G5V/issues) page to track what calls still need to be completed.

Expand All @@ -65,6 +77,7 @@ Sure! If you have a knack for APIs and a penchant for JavaScript, I could always
- [Sean Lewis](https://github.com/splewis) for the creation of get5.
- Smimabo for helping me test endlessly for the match API to ensure stats record as they should.
- ebuttonsdude for letting me host an instance for testing on his server.
- [kubo6472](https://github.com/kubo6472) for helping with Github Actions and creating packages for use with docker-compose.

### Screenshots
![](./screenshots/MainPage.png)
Expand Down
Binary file added public/img/maps/de_ancient.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/maps/de_vertigo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 167eea9

Please sign in to comment.