mirror of https://github.com/snachodog/mybuddy.git
Update docker-compose config using an environment file.
This commit is contained in:
parent
c4527cbced
commit
12254b0861
|
@ -5,6 +5,9 @@
|
|||
# database
|
||||
*.sqlite3
|
||||
|
||||
# docker
|
||||
docker.env
|
||||
|
||||
# npm folder
|
||||
/node_modules
|
||||
|
||||
|
|
15
Dockerfile
15
Dockerfile
|
@ -5,16 +5,15 @@ ADD package-lock.json /build/
|
|||
RUN npm install
|
||||
RUN npm install -g gulp-cli
|
||||
ADD gulpfile.js /build/gulpfile.js
|
||||
ADD api /app/api
|
||||
ADD babybuddy /app/babybuddy
|
||||
ADD core /app/core
|
||||
ADD dashboard /app/dashboard
|
||||
ADD reports /app/reports
|
||||
ADD api /build/api
|
||||
ADD babybuddy /build/babybuddy
|
||||
ADD core /build/core
|
||||
ADD dashboard /build/dashboard
|
||||
ADD reports /build/reports
|
||||
RUN gulp build
|
||||
|
||||
|
||||
FROM python:3 as app
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
RUN pip install --upgrade pipenv gunicorn
|
||||
WORKDIR /app
|
||||
COPY Pipfile /app/
|
||||
|
@ -26,9 +25,5 @@ ADD babybuddy /app/babybuddy
|
|||
ADD core /app/core
|
||||
ADD dashboard /app/dashboard
|
||||
ADD reports /app/reports
|
||||
ENV DJANGO_SETTINGS_MODULE babybuddy.settings.development
|
||||
ENV SECRET_KEY TODOCHANGEME
|
||||
COPY --from=build /build/babybuddy/static /app/babybuddy/static
|
||||
RUN python manage.py collectstatic --no-input
|
||||
RUN python manage.py migrate
|
||||
ADD etc/gunicorn.py /app/
|
||||
|
|
|
@ -3,13 +3,15 @@ import os
|
|||
from .base import * # noqa: F401,F403
|
||||
|
||||
|
||||
DEBUG = os.environ.get('DEBUG', False)
|
||||
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
# Production settings
|
||||
# See babybuddy.settings.base for additional settings information.
|
||||
|
||||
SECRET_KEY = os.environ.get('SECRET_KEY')
|
||||
|
||||
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', '').split(',')
|
||||
|
||||
DEBUG = os.environ.get('DEBUG', False)
|
||||
|
||||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
|
||||
|
|
|
@ -4,6 +4,7 @@ services:
|
|||
db:
|
||||
image: postgres
|
||||
web:
|
||||
env_file: docker.env
|
||||
build: .
|
||||
command: gunicorn -c /app/gunicorn.py babybuddy.wsgi
|
||||
ports:
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
ALLOWED_HOSTS=
|
||||
DJANGO_SETTINGS_MODULE=babybuddy.settings.docker
|
||||
PYTHONUNBUFFERED=1
|
||||
SECRET_KEY=
|
Loading…
Reference in New Issue