Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kthoden committed Sep 8, 2020
2 parents 7f5dcb8 + de74df7 commit 3d1b4a8
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 23 deletions.
26 changes: 13 additions & 13 deletions docker-compose.yaml
Expand Up @@ -2,22 +2,22 @@ version: '3.7'

services:

db:
image: postgres:11
volumes:
- ./${DATABASE_DATA_DIR}:${DATABASE_DATA_DIR_IN_CONTAINER}
container_name: ${DB_CONTAINER}
user: ${USER}:${GROUP}
environment:
# postgres data dir
- PGDATA=${DATABASE_DATA_DIR_IN_CONTAINER}
# postgres user
- POSTGRES_USER=postgres
# db:
# image: postgres:11
# volumes:
# - ./${DATABASE_DATA_DIR}:${DATABASE_DATA_DIR_IN_CONTAINER}
# container_name: ${DB_CONTAINER}
# user: ${USER}:${GROUP}
# environment:
# # postgres data dir
# - PGDATA=${DATABASE_DATA_DIR_IN_CONTAINER}
# # postgres user
# - POSTGRES_USER=postgres

# eoa-django
webserver:
depends_on:
- db
# depends_on:
# - db
build: .
image: ${WEB_SERVER_IMAGE}
container_name: ${WEB_SERVER_CONTAINER}
Expand Down
4 changes: 2 additions & 2 deletions scripts/config/env_default.conf
Expand Up @@ -13,8 +13,8 @@ DEPENDENCIES_DIR=dependencies

RUNTIME_DIR=runtime_data

DATABASE_DATA_DIR=${RUNTIME_DIR}/postgres_data
DATABASE_DATA_DIR_IN_CONTAINER=/eoa/postgres_data
# DATABASE_DATA_DIR=${RUNTIME_DIR}/postgres_data
# DATABASE_DATA_DIR_IN_CONTAINER=/eoa/postgres_data

SRC_DIR=src
SRC_DIR_IN_CONTAINER=/eoa/server
Expand Down
6 changes: 3 additions & 3 deletions scripts/init.py
Expand Up @@ -39,9 +39,9 @@ def create_dirs( config ):
BASE_DIR / config['RES_DIR'] / "static/custom_static"
)

create_dir(
BASE_DIR / config['DATABASE_DATA_DIR']
)
# create_dir(
# BASE_DIR / config['DATABASE_DATA_DIR']
# )

"""
this extra copy is necessary in order to
Expand Down
17 changes: 12 additions & 5 deletions src/eoa/settings.py
Expand Up @@ -127,11 +127,18 @@

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'postgres',
'USER': 'postgres',
'HOST': 'db',
'PORT': '5432',
'CONN_MAX_AGE': 0,
'ENGINE': 'django.db.backends.sqlite3',
'HOST': 'localhost',
'NAME': 'project.db',
'PASSWORD': '',
'PORT': '',
'USER': ''
# 'ENGINE': 'django.db.backends.postgresql',
# 'NAME': 'postgres',
# 'USER': 'postgres',
# 'HOST': 'db',
# 'PORT': '5432',
}
}

Expand Down
Binary file added src/project.db
Binary file not shown.

0 comments on commit 3d1b4a8

Please sign in to comment.