Add docker, partialy from kers

This commit is contained in:
mcbloch 2021-05-17 21:42:11 +02:00
parent 654ff5814f
commit 2470241f57
5 changed files with 42 additions and 0 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
db.sqlite3

12
Dockerfile Normal file
View File

@ -0,0 +1,12 @@
FROM python:3.8.5-alpine3.12
RUN mkdir code
WORKDIR code
RUN apk add --no-cache gcc musl-dev linux-headers mariadb-dev
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
COPY . .

17
docker-compose.yml Normal file
View File

@ -0,0 +1,17 @@
version: "3"
services:
web:
build: .
ports:
- "8000:8000"
env_file: "web.env"
restart: on-failure
volumes:
- mordor_db:/db.sqlite3
- /var/www/mordor/static:/static
command: >
sh -c "python manage.py collectstatic --no-input
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
volumes:
mordor_db:

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
Django==3.2
requests==2.25.1

10
web.env Normal file
View File

@ -0,0 +1,10 @@
DATABASE_HOST=database
SECRET_KEY=REPLACEME
DEBUG=1
BASE_URL=http://localhost:8000
OAUTH_CLIENT_ID=REPLACEME
OAUTH_CLIENT_SECRET=REPLACEME
MORDOR_ADMIN_USERNAME=replaceme
MORDOR_ADMIN_PASSWORD=replaceme
ALLOWED_HOSTS=localhost
STATIC_ROOT=/static