Skip to content
Snippets Groups Projects
Commit 5df6c9f1 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Create .env file to store default compose variables

- add build instruction to docker-compose.yml
parent 90184b32
No related branches found
No related tags found
No related merge requests found
...@@ -3,3 +3,4 @@ ...@@ -3,3 +3,4 @@
__pycache__ __pycache__
settings*.cfg settings*.cfg
client client
data
.env 0 → 100644
POSTGRES_USER=ics
POSTGRES_PASSWORD=icspwd
POSTGRES_DB=inventory_db
PGDATA_VOLUME=./data/dev
...@@ -3,3 +3,4 @@ ...@@ -3,3 +3,4 @@
__pycache__ __pycache__
*.pyc *.pyc
settings*.cfg settings*.cfg
/data
...@@ -11,10 +11,9 @@ You can use docker for development: ...@@ -11,10 +11,9 @@ You can use docker for development:
1. Clone the repository 1. Clone the repository
2. Create the database:: 2. Create the database. Data will be stored under "./data" by default.
You can export the PGDATA_VOLUME variable to use another directory::
$ mkdir /data/pgdata
$ export PGDATA_VOLUME=/data/pgdata
# Start only postgres so it has time to initialize # Start only postgres so it has time to initialize
$ docker-compose up -d postgres $ docker-compose up -d postgres
# Create the database # Create the database
......
...@@ -3,6 +3,7 @@ services: ...@@ -3,6 +3,7 @@ services:
web: web:
image: inventory image: inventory
container_name: inventory_web container_name: inventory_web
build: .
environment: environment:
LOCAL_SETTINGS: /app/settings.cfg LOCAL_SETTINGS: /app/settings.cfg
FLASK_APP: /app/wsgi.py FLASK_APP: /app/wsgi.py
...@@ -22,7 +23,7 @@ services: ...@@ -22,7 +23,7 @@ services:
volumes: volumes:
- ${PGDATA_VOLUME}:/var/lib/postgresql/data/pgdata - ${PGDATA_VOLUME}:/var/lib/postgresql/data/pgdata
environment: environment:
POSTGRES_USER: ics POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: icspwd POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: inventory_db POSTGRES_DB: ${POSTGRES_DB}
PGDATA: /var/lib/postgresql/data/pgdata PGDATA: /var/lib/postgresql/data/pgdata
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment