Skip to content

Update the README with deploy instructions #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 16 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
# flask-nginx-starter
A starter repo for a flask + nginx Docker container

Setting up local installations on a Mac
=========================
1. You'll need a keys.sh file in the local_files directory.
2. PostgresApp needs to be installed on your computer
3. brew install postgres
4. brew install bcrypt
5. brew install openssl
6. If you don't have python virtualenvs setup, follow the instructions here (starting at installing virtualenv): https://newcoder.io/pyladiessf
7. mkvirtualenv deploy
8. pip install -r ./docker_files/requirements.txt

Creating a Local Database
=========================
1. To create a local database, type: psql -h localhost
2. CREATE DATABASE [db_name];

Running the app locally
=========================
1. Run: ./run_local.sh
2. Go to localhost:7070 to see your home page!
3. Application logs can be accessed with: tail -f ./application.log
## Step 1
- If you want to use this repo as a jumping off point for your repo, duplicate it. (If you forking it, it remains public.) To publicate it, clone the repository, update the git remote, and then push it up as a new repository under the new organization. There are more details [here](https://help.github.com/articles/duplicating-a-repository/)

- If you want to deploy this as an example, and pull the relevant parts into your own flask app, copy the [`Dockerfile`](https://github.com/opsolutely/flask-nginx-starter/blob/master/Dockerfile), [`nginx.conf`](https://github.com/opsolutely/flask-nginx-starter/blob/master/nginx.conf), [`run_local.sh`](https://github.com/opsolutely/flask-nginx-starter/blob/master/run_local.sh), and the [`docker_files` directory](https://github.com/opsolutely/flask-nginx-starter/tree/master/docker_files) into the root of your repository.

- If you're only demoing, then the easiest thing is to deploy this repository as-is, without duplicating or pulling the configuration into your own repository.

## Step 2
In Opsolutely, select the repository to deploy, and when the you specify the dockerfile location, set up two Volumes:
Make the contents of `opsolutely/flask-nginx-starter/docker_files/supervisord.conf` available in the container at `/etc/supervisor/conf.d/supervisord.conf`, and make `opsolutely/flask-nginx-starter/docker_files/service.conf` also available at `/etc/nginx/sites-enabled/service.conf`. (You could alternatively add this in the dockerfile directly, but this is a nice way to try out the UI.)

## Step 3
Answer a few painless questions, and click deploy! :rocket: