Switch to docker so can use mjml easily
This commit is contained in:
parent
12a6cd119d
commit
7b8fc5fe18
|
@ -0,0 +1,9 @@
|
|||
var/
|
||||
venv/
|
||||
*.egg-info/
|
||||
dist/
|
||||
.idea
|
||||
.DS_Store
|
||||
.vscode
|
||||
build/
|
||||
__pycache__/
|
|
@ -1,9 +1,7 @@
|
|||
var/
|
||||
venv/
|
||||
*.egg-info/
|
||||
node_modules/
|
||||
dist/
|
||||
birdsongtestbed/static
|
||||
*.pyc
|
||||
*.local
|
||||
.tmp
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
FROM python:3.6
|
||||
|
||||
WORKDIR /srv
|
||||
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONIOENCODING=UTF-8 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
LC_ALL=C.UTF-8 \
|
||||
LANG=C.UTF-8 \
|
||||
PYTHONPATH=/srv/ \
|
||||
DJANGO_SETTINGS_MODULE=settings_dev \
|
||||
DJANGO_SUPERUSER_PASSWORD=p
|
||||
|
||||
COPY . /srv/
|
||||
|
||||
RUN pip install -e .
|
||||
RUN django-admin migrate
|
||||
RUN django-admin createsuperuser --no-input --username admin --email admin@email.com
|
||||
|
||||
CMD [ "django-admin" , "runserver", "0.0.0.0:8080"]
|
|
@ -0,0 +1,26 @@
|
|||
version: "3"
|
||||
|
||||
services:
|
||||
birdsong:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.dev
|
||||
restart: always
|
||||
command: django-admin runserver 0.0.0.0:8080
|
||||
links:
|
||||
- mjml
|
||||
ports:
|
||||
- "8080:8080"
|
||||
container_name: 'birdsong_dev'
|
||||
working_dir: '/srv'
|
||||
volumes:
|
||||
- './tests:/srv/tests'
|
||||
- './birdsong:/srv/birdsong'
|
||||
- './settings_dev.py:/srv/settings_dev.py'
|
||||
# - './local.sqlite3:/srv/local.sqlite3'
|
||||
|
||||
mjml:
|
||||
image: liminspace/mjml-tcpserver:latest
|
||||
restart: always
|
||||
ports:
|
||||
- "28101"
|
21
manage.py
21
manage.py
|
@ -1,21 +0,0 @@
|
|||
#!/usr/bin/env python3.6
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
|
||||
def run():
|
||||
from django.core.management import execute_from_command_line
|
||||
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings_dev'
|
||||
args = sys.argv[:]
|
||||
if len(args) == 2 and sys.argv[1] == 'runserver':
|
||||
# Default to serving externally if not told otherwise
|
||||
args = sys.argv + ['0.0.0.0:8080']
|
||||
|
||||
execute_from_command_line(args)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
run()
|
|
@ -8,4 +8,9 @@ DATABASES = {
|
|||
},
|
||||
}
|
||||
|
||||
ALLOWED_HOSTS = ['*']
|
||||
ALLOWED_HOSTS = ['*']
|
||||
|
||||
MJML_BACKEND_MODE = 'tcpserver'
|
||||
MJML_TCPSERVERS = [
|
||||
('mjml', 28101), # host and port
|
||||
]
|
Loading…
Reference in New Issue