Skip to content

Commit

Permalink
readonly database issues fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
James Wallace authored and James Wallace committed Apr 15, 2020
1 parent 0cdb343 commit 0ffad8c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ ADD entrypoint.dev.sh .
# add the project
ADD . .

# expose port 80
EXPOSE 80

# grant execute permissions to entrypoint script
RUN ["chmod", "+x", "/usr/src/app/entrypoint.dev.sh"]

# run entrypoint
# run entrypoint script
ENTRYPOINT ["/usr/src/app/entrypoint.dev.sh"]
14 changes: 0 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,3 @@ services:
- 8000:80
env_file:
- env/.env.dev
depends_on:
- db

db:
image: postgres:12
ports:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- env/.env.dev.db

volumes:
postgres_data:
3 changes: 3 additions & 0 deletions entrypoint.dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
python manage.py makemigrations
python manage.py migrate
python manage.py collectstatic --noinput
chmod 664 /usr/src/app/db.sqlite3
chown www-data /usr/src/app/db.sqlite3
chown www-data /usr/src/app
apache2ctl -D FOREGROUND

exec "$@"
8 changes: 2 additions & 6 deletions website/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,8 @@

DATABASES = {
'default': {
'ENGINE': os.environ.get('SQL_ENGINE', 'django.db.backends.postgresql'),
'NAME': os.environ.get('SQL_DATABASE', 'bartensordb'),
'USER': os.environ.get('SQL_USER', 'bartensoradmin'),
'PASSWORD': os.environ.get('SQL_PASSWORD', 'BartensorOSU!'),
'HOST': os.environ.get('SQL_HOST', 'localhost'),
'PORT': os.environ.get('SQL_PORT', '5432')
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}

Expand Down

0 comments on commit 0ffad8c

Please sign in to comment.