From 5c4a043d85216a3d331cfa43a945d1c2583ad5ad Mon Sep 17 00:00:00 2001 From: Kyle Rockman Date: Wed, 6 Sep 2017 08:13:27 -0500 Subject: [PATCH] fix running for prod locally, add description to create object, --- README.md | 4 ++-- docker-compose.yml | 17 ++++++++++++++++- .../assets/js/components/DashboardListView.jsx | 9 +++++++++ estate/assets/js/components/Nav.jsx | 2 +- estate/settings/logging.py | 12 +++++++++++- estate/templates/index.html | 8 -------- webpack/webpack.base.config.js | 3 +-- 7 files changed, 40 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 398371d..f5f8db3 100644 --- a/README.md +++ b/README.md @@ -112,9 +112,9 @@ If you wish to hack on Estate, you'll first need to understand its architecture. Estate is a single docker container that runs a [Django](https://www.djangoproject.com/) application with [Gunicorn](http://gunicorn.org/) workers. The backend leverages [Django Rest Framework](http://www.django-rest-framework.org/) to design it REST API functionality. The frontend is compiled by [Webpack](https://webpack.github.io/) using a standard single page app design that leverages [React](https://facebook.github.io/react/) + [Redux](http://redux.js.org/). -Local development has been made a breeze, and long build/compile times have been reduced as much as possible. To get started use [Git](https://git-scm.com/) to clone this repository and run `docker-compose build` from the root of the repository. Once the build has completed you only need to run this command again if you change the Dockerfile itself, from here on out any changes you make to the codebase will be detected and use hot-reloading techniques to update the running application. +Local development has been made a breeze, and long build/compile times have been reduced as much as possible. To get started use [Git](https://git-scm.com/) to clone this repository and run `docker-compose build dev` from the root of the repository. Once the build has completed you only need to run this command again if you change the Dockerfile itself, from here on out any changes you make to the codebase will be detected and use hot-reloading techniques to update the running application. -To start up the application just use `docker-compose up` this will spin up a series of containers, as well as Estate itself, and then you can begin editing the code. +To start up the application just use `docker-compose up dev` this will spin up a series of containers, as well as Estate itself, and then you can begin editing the code. Contributing ------------ diff --git a/docker-compose.yml b/docker-compose.yml index 8018f03..24c9634 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -service: +dev: build: . dockerfile: Dockerfile command: local @@ -19,6 +19,21 @@ service: - consul:consul - vault:vault +prod: + build: . + dockerfile: Dockerfile + ports: + - 8000:8000 + volumes: + - /var/run/docker.sock:/var/run/docker.sock + environment: + - "DATABASE_URL=postgres://postgres:estate@postgres:5432/estate" + - "GUNICORN_WORKER_COUNT=5" + links: + - postgres:postgres + - consul:consul + - vault:vault + postgres: image: postgres:9.5 environment: diff --git a/estate/assets/js/components/DashboardListView.jsx b/estate/assets/js/components/DashboardListView.jsx index bb41b5e..8ed213a 100644 --- a/estate/assets/js/components/DashboardListView.jsx +++ b/estate/assets/js/components/DashboardListView.jsx @@ -11,14 +11,19 @@ class CreateObjectModal extends React.Component { super(props, context) this.state = { title: false, + description: false, } } onTitleChange(value) { this.setState({ title: value.target.value}) } + onDescriptionChange(value) { + this.setState({ description: value.target.value}) + } getResult() { return { title: this.state.title || false, + description: this.state.description || false, dependencies: [], version_increment: "initial", } @@ -33,6 +38,10 @@ class CreateObjectModal extends React.Component { +
+ + +
) } diff --git a/estate/assets/js/components/Nav.jsx b/estate/assets/js/components/Nav.jsx index 33f90e7..8e189e3 100644 --- a/estate/assets/js/components/Nav.jsx +++ b/estate/assets/js/components/Nav.jsx @@ -23,7 +23,7 @@ class Nav extends React.Component {
  • API Docs
  • Administration
  • -
    +
    {this.props.token ?
    Logout
    : null }
    diff --git a/estate/settings/logging.py b/estate/settings/logging.py index 511a1bd..1430fb6 100644 --- a/estate/settings/logging.py +++ b/estate/settings/logging.py @@ -66,6 +66,16 @@ 'level': 'INFO', 'handlers': ['stdout'], 'propagate': False, - } + }, + 'gunicorn.error': { + 'level': 'INFO', + 'handlers': ['stdout'], + 'propagate': False, + }, + 'gunicorn.access': { + 'level': 'INFO', + 'handlers': ['stdout'], + 'propagate': False, + }, } } diff --git a/estate/templates/index.html b/estate/templates/index.html index 09e2758..984f821 100644 --- a/estate/templates/index.html +++ b/estate/templates/index.html @@ -1,5 +1,4 @@ -{% load staticfiles %} {% load render_bundle from webpack_loader %} @@ -26,13 +25,6 @@
    - - {% render_bundle 'main' %} diff --git a/webpack/webpack.base.config.js b/webpack/webpack.base.config.js index 4c637c0..06417c9 100644 --- a/webpack/webpack.base.config.js +++ b/webpack/webpack.base.config.js @@ -19,8 +19,7 @@ module.exports = { $: 'jquery', jQuery: 'jquery', 'window.jQuery': 'jquery' - }), - new webpack.optimize.UglifyJsPlugin() + }) ], // add all common plugins here module: {