Skip to content

Commit

Permalink
Merge pull request opengaming#1277 from caiotava/feat/add-docker-recipes
Browse files Browse the repository at this point in the history
Add Makefile recipes to help run the server with Docker
  • Loading branch information
wonea authored Mar 24, 2021
2 parents 5d62d9b + 6e4e901 commit a8e7b57
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
PORT=80

run:
pipenv run ./render.py

prod:
./render.py && htmlmin _build/index.html _build/index.html

docker-build:
docker build -t opengaming/osgameclones .

docker-run:
-docker rm -f osgameclones-site
docker run -d -p${PORT}:80 --name osgameclones-site opengaming/osgameclones

.PHONY:
run prod docker-build docker-run
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,27 @@ Simply run the following to build the project into the `_build` directory.
make
```

### Running the server with Docker

You must first build a Docker image

```bash
make docker-build
```

After building the docker image, run the server with Docker

```bash
make docker-run
```

The server will be available at http://localhost:80, you can choose the port with the **PORT** variable.

```bash
# The server will be available at http://localhost:3000
make docker-run PORT=3000
```

## License

See [LICENSE][license]
Expand Down

0 comments on commit a8e7b57

Please sign in to comment.