Skip to content

Commit 25ff189

Browse files
Merge pull request #3 from onlinejudge95/dev
Adds Docker support
2 parents e172272 + fd50da8 commit 25ff189

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
__pycache__/
2+
.git/
3+
.pip.cache/
4+
.vscode/
5+
env/
6+
7+
.env.example
8+
.gitignore
9+
.isort.cfg

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ python:
1010

1111
cache: pip
1212

13+
env:
14+
global:
15+
- FLASK_ENV=testing
16+
- FLASK_DEBUG=False
17+
1318
install:
1419
- pip install --cache-dir .pip.cache/ --progress-bar emoji --upgrade pip setuptools
1520
- pip install --cache-dir .pip.cache/ --progress-bar emoji --requirement requirements/test.txt

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM ubuntu:18.04
2+
3+
RUN apt-get update -y
4+
RUN apt-get install -y python3.7 python3.7-dev python3.7-venv python3-venv
5+
6+
RUN mkdir -p /var/www/backend
7+
WORKDIR /var/www/backend
8+
9+
COPY . .
10+
11+
RUN python3.7 -m venv env && \
12+
./env/bin/pip install --no-cache-dir --upgrade pip setuptools && \
13+
./env/bin/pip install --no-cache-dir --progress-bar emoji --requirement requirements/prod.txt
14+
15+
CMD [ "env/bin/gunicorn", "--bind", "0.0.0.0:8000", "--workers", "4", "manage:app" ]

0 commit comments

Comments
 (0)