Skip to content

Commit

Permalink
Merge pull request #17 from divyanshusahu/docker
Browse files Browse the repository at this point in the history
docker setup
  • Loading branch information
divyanshusahu authored Jun 25, 2022
2 parents cf35359 + 2fe266e commit 1c428e7
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ teams/migrations
forums/__pycache__
forums/migrations
.vscode
.env
.env
.python-version
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.8.13-slim-bullseye

RUN mkdir /code
WORKDIR /code
COPY . .
RUN pip install -r requirements.txt
RUN python manage.py makemigrations accounts challenges forums
RUN python manage.py migrate

EXPOSE 8000
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
docker_build:
docker build -t minictf .

docker_run:
docker run --rm -it -p 8000:8000 minictf:latest
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,24 @@ Discussion Forums
<img src="readmeimg/forum.png" width="100%">


#### Test it locally
#### Dev env setup

###### Requirments
##### Requirments

> Rename .env.example to .env and change the value of KEY.
>
> **Note**: Keep this value a secret.
###### Docker Setup

```bash
make docker_build
make docker_run
```

This will start the server at port 8000.

###### Local Setup

```
python 3.x
Expand All @@ -51,10 +66,6 @@ django 2.0

Install [Pipenv](https://pypi.org/project/pipenv/)

> Rename .env.example to .env and change the value of KEY.
>
> **Note**: Keep this value a secret.
<b>Want to make this process fast. Switch to [local branch](https://github.com/DivyanshuSahu/miniCTF/tree/local)</b>

###### Install miniCTF
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Django==2.0
python-dotenv==0.14.0
pytz==2020.1

0 comments on commit 1c428e7

Please sign in to comment.