Skip to content

Update README and LICENSE #1

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

Merged
merged 2 commits into from
Mar 14, 2018
Merged
Show file tree
Hide file tree
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
4 changes: 0 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
MIT License

<<<<<<< HEAD
Copyright (c) 2016 Marco Hemken
=======
Copyright (c) 2017 Marco Hemken
>>>>>>> 92464404e051ef169601a1f9b998df0b6ed66e71

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

This is a simple demo for how to connect to a Postgres database from a python flask application. To run this on your computer you must first install [docker](https://docs.docker.com/engine/installation/).

##Running
## Running

First fork the repo then do a ```git clone```.
First fork the repo then do a `git clone`.

git clone https://github.com/<yournamehere>/docker-flask-postgres

Expand All @@ -13,13 +13,11 @@ You should also have [docker](https://docs.docker.com/install/). If you're on li
Once you have all of that, you should be good. No need to install [Postgres](https://www.postgresql.org/) or even Python.

```
alias fig="docker-compose"
docker-compose up --build -d # Run the container.

fig up --build -d #Run the container
docker-compose down # Stop and remove everything.

fig down #Stop and remove everything

# Add your code to the /app/ directory
# Add your code to the /app/ directory.
# At the moment, you have to do a fig up/down after each change.
```

Expand Down
3 changes: 1 addition & 2 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

DBUSER = 'marco'
DBPASS = 'foobarbaz'
DBHOST = 'database'
DBHOST = 'db'
DBPORT = '5432'
DBNAME = 'testdb'

Expand Down Expand Up @@ -79,4 +79,3 @@ def home():
dbstatus = True
database_initialization_sequence()
app.run(debug=True, host='0.0.0.0')

2 changes: 1 addition & 1 deletion base-image/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Base image for flask REST api tutorial

FROM alpine:3.4
FROM alpine:3.7

ADD requirements.txt /home/app/
WORKDIR /home/app/
Expand Down
2 changes: 1 addition & 1 deletion base-image/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Find this image on Dockerhub
# Find this image on Dockerhub

This is the Dockerfile I used in my `fanoftal2/alpine-flask-base` image. Check it out on [Dockerhub](https://hub.docker.com/r/fanoftal2/alpine-flask-base/).
14 changes: 7 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
version: '2'
version: "3"
services:
flaskapp:
web:
build: .
ports:
- "43434:5000"
- "5000:5000"
volumes:
- ./app:/home/app/
- ./app/:/home/app/
depends_on:
- database
database:
image: postgres:9
- db
db:
image: postgres:10
env_file: .env
expose:
- 5432