Skip to content

Commit

Permalink
fix running for prod locally, add description to create object,
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle Rockman committed Sep 6, 2017
1 parent ffba4f1 commit 5c4a043
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------
Expand Down
17 changes: 16 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
service:
dev:
build: .
dockerfile: Dockerfile
command: local
Expand All @@ -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:
Expand Down
9 changes: 9 additions & 0 deletions estate/assets/js/components/DashboardListView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
Expand All @@ -33,6 +38,10 @@ class CreateObjectModal extends React.Component {
<label>Title</label>
<input type="text" className="form-control" onChange={this.onTitleChange.bind(this)} />
</div>
<div className="form-group">
<label>Description</label>
<input type="text" className="form-control" onChange={this.onDescriptionChange.bind(this)} />
</div>
</Modal>
)
}
Expand Down
2 changes: 1 addition & 1 deletion estate/assets/js/components/Nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Nav extends React.Component {
<li><a href="/api/"> API Docs </a></li>
<li><a href="/admin/"> Administration </a></li>
</ul>
<div className="navbar-form navbar-right" style={{marginRight: "20px"}}>
<div className="navbar-form navbar-right" style={{marginRight: "1%"}}>
<Search />
{this.props.token ? <div className="btn btn-default" style={{marginLeft: "10px"}} onClick={this.props.logout}>Logout</div> : null }
</div>
Expand Down
12 changes: 11 additions & 1 deletion estate/settings/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}
}
8 changes: 0 additions & 8 deletions estate/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<!--{% load raven %}-->
{% load staticfiles %}
{% load render_bundle from webpack_loader %}

<!DOCTYPE html>
Expand All @@ -26,13 +25,6 @@
</head>
<body>
<div id="root"></div>
<script>
window.drf = {
csrfHeaderName: "X-CSRFToken",
csrfCookieName: 'csrftoken'
};
</script>
<script type="text/javascript" src="{% static 'rest_framework/js/csrf.js' %}"></script>
{% render_bundle 'main' %}
</body>
</html>
3 changes: 1 addition & 2 deletions webpack/webpack.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ module.exports = {
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery'
}),
new webpack.optimize.UglifyJsPlugin()
})
], // add all common plugins here

module: {
Expand Down

0 comments on commit 5c4a043

Please sign in to comment.