Skip to content

Commit 4df9086

Browse files
authored
Merge pull request #48 from ebuttonsdude/master
Add Dockerfiles
2 parents e422790 + 568b063 commit 4df9086

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

DockerfileFull

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM nginx:stable-alpine
2+
3+
# install prerequisits
4+
RUN apk update && apk add \
5+
nodejs \
6+
yarn
7+
8+
# create folder and copy application into folder
9+
RUN mkdir G5V
10+
COPY ./ /G5V/
11+
WORKDIR /G5V
12+
13+
# build application using yarn
14+
RUN yarn && yarn build
15+
16+
# copy results to nginx directory
17+
RUN cp -R ./dist/* /usr/share/nginx/html

DockerfileLight

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM nginx:stable-alpine
2+
COPY ./dist /usr/share/nginx/html

README.md

+19
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,25 @@ Spins up a development server where you can make all your calls, and run it like
3838

3939
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).
4040

41+
### Docker Build Instructions:
42+
There are 2 dockerfiles included, ```DockerfileLight``` and ```DockerfileFull```.
43+
44+
#### DockerfileLight:
45+
This should be used if yarn is already installed on your local machine.
46+
To use it, you first need to build the application using ```yarn``` and ```yarn build```. This will create a dist folder.
47+
From here, run the command ```docker build -t yourname\g5v:latest -f DockerfileLight .```
48+
Now, you can run your application by running ```docker container run --name g5v -p 80:80 yourname\g5v:latest```
49+
50+
#### DockerfileFull:
51+
This should be used if you do not have yarn, and do not want to install it.
52+
This file will install yarn in the container, build the application, and execute it.
53+
To use it, run ```docker build -t yourname\g5v:latest -f DockerfileFull .```
54+
This can take over a minute to complete.
55+
Now, you can run your application by running ```docker container run --name g5v -p 80:80 yourname\g5v:latest```
56+
57+
Please note that both of the dockerfiles still require G5API to be running on the subfolder /api/.
58+
Some example setup configs can be found [here](https://github.com/PhlexPlexico/G5V/wiki).
59+
4160
## Contribution
4261
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.
4362

0 commit comments

Comments
 (0)