Browse Source

docker-compose file uploaded for single command deployment

pull/40/head
10eMyrT 4 years ago
parent
commit
5f894d93cd
2 changed files with 35 additions and 0 deletions
  1. +22
    -0
      README.md
  2. +13
    -0
      docker-compose.yml

+ 22
- 0
README.md View File

@ -71,10 +71,32 @@ Github-graphs can also be deployed inside a docker container and displayed in
your browser through port mapping. To get started run the following commands your browser through port mapping. To get started run the following commands
inside your forked repository. inside your forked repository.
The easiest way to deploy in a docker container is through the use of our proposed
`docker-compose.yml` file. If you choose this methodology, make sure the port numbers
in your `.env` file matches the docker-compose file. Note that this approach will work
only on systems which have Docker and Docker-compose both installed.
Considering the example provided in our provided docker-compose,
the port number of the .env file should be `PORT= 8000`. Therefore, you could
visualize the Github-Graphs page at `localhost:8080` after running:
```
docker-compose up -d --build
```
In order to clean the environment, you can run the following command.
```
docker-compose down --rmi all
```
Besides the use of docker-compose, deployment with just docker is possible with the following commands:\
``` ```
docker build -t <choose_name_for_image> . docker build -t <choose_name_for_image> .
docker run -d --name <choose_name_for_container> -p <local_port_num>:<port_num_from_env_file> <name_of_image> docker run -d --name <choose_name_for_container> -p <local_port_num>:<port_num_from_env_file> <name_of_image>
``` ```
For instance, assume I name my image `graph-app`, my container `github-graphs`, For instance, assume I name my image `graph-app`, my container `github-graphs`,
and set the port number in my .env file to `8000`, I can decide to listen on my localhost at port `8080`. and set the port number in my .env file to `8000`, I can decide to listen on my localhost at port `8080`.
Therefore, my commands are: Therefore, my commands are:

+ 13
- 0
docker-compose.yml View File

@ -0,0 +1,13 @@
version: '3.7'
services:
github-graphs:
build:
context: .
dockerfile: Dockerfile
image: graph-app:latest
container_name: github-graphs
ports:
- "8080:8000"
command: /bin/bash

Loading…
Cancel
Save