Update Docker deployment config.

This commit is contained in:
Christopher Charbonneau Wells 2018-11-04 08:37:33 -08:00
parent 5e728767cf
commit 69fcfd65b9
2 changed files with 3 additions and 25 deletions

View File

@ -1,19 +1,3 @@
FROM node:8 as build
WORKDIR /build
ADD package.json /build/
ADD package-lock.json /build/
RUN npm install
RUN npm install -g gulp-cli
ADD gulpfile.js /build/gulpfile.js
ADD gulpfile.config.js /build/gulpfile.config.js
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 FROM python:3 as app
ENV PYTHONUNBUFFERED 1 ENV PYTHONUNBUFFERED 1
RUN pip install --upgrade pipenv gunicorn RUN pip install --upgrade pipenv gunicorn
@ -27,5 +11,5 @@ ADD babybuddy /app/babybuddy
ADD core /app/core ADD core /app/core
ADD dashboard /app/dashboard ADD dashboard /app/dashboard
ADD reports /app/reports ADD reports /app/reports
COPY --from=build /build/babybuddy/static /app/babybuddy/static ADD static /app/static
ADD etc/gunicorn.py /app/ ADD etc/gunicorn.py /app/

View File

@ -83,11 +83,9 @@ redeploy the app (e.g. if there are errors or settings are changed).
### Docker ### Docker
A Docker deploy requires [Docker](http://docker.com/) and A Docker deployment requires [Docker](http://docker.com/) and
[Docker Compose](https://docs.docker.com/compose/overview/) to create two [Docker Compose](https://docs.docker.com/compose/overview/) to create two
containers - one for the database and one for the application. Baby Buddy uses a containers - one for the database and one for the application.
[multi-stage build](https://docs.docker.com/engine/userguide/eng-image/multistage-build/),
which requires Docker version 17.05 or newer.
1. Copy the `docker.env.example` to `docker.env` and set the `ALLOWED_HOSTS` and 1. Copy the `docker.env.example` to `docker.env` and set the `ALLOWED_HOSTS` and
`SECRET_KEY` variables within `SECRET_KEY` variables within
@ -106,10 +104,6 @@ which requires Docker version 17.05 or newer.
docker-compose exec app python manage.py migrate docker-compose exec app python manage.py migrate
1. Initialize static assets *(first run/after updates)*
docker-compose exec app python manage.py collectstatic
The app should now be locally available at The app should now be locally available at
[http://127.0.0.1:8000](http://127.0.0.1:8000). See [http://127.0.0.1:8000](http://127.0.0.1:8000). See
[Get Started, Part 6: Deploy your app](https://docs.docker.com/get-started/part6/) [Get Started, Part 6: Deploy your app](https://docs.docker.com/get-started/part6/)