Skip to content

Commit

Permalink
feat(#36): Edit docker-compose and development_settings.py
Browse files Browse the repository at this point in the history
Now the deploy with docker should be okey.

Instructions to run the application with docker and review the pull request:
-Have the docker environment installed on the device (if it is windows, have the linux subsystem for windows installed)
-Run the command 'docker-compose up -d'
-Go to the browser and put the url 'localhost:8000'
  • Loading branch information
TomasCB24 committed Nov 29, 2022
1 parent 1961c2d commit 4028468
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM python:3.10.7

ENV PYTHONUNBUFFERED 1
ENV HOST_URL host.docker.internal

RUN mkdir /code
WORKDIR /code
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ services:
- "8000:8000"
depends_on:
- db

deploy:
restart_policy:
condition: on-failure

3 changes: 2 additions & 1 deletion innoweb/development_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

from pathlib import Path
import os

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
Expand Down Expand Up @@ -88,7 +89,7 @@
'NAME' : 'innowebdb',
'USER' : 'innosoft',
'PASSWORD': 'innosoft-2022',
'HOST' : 'db',
'HOST' : os.environ.get('HOST_URL', '127.0.0.1'),
'PORT' : '3307',
}
}
Expand Down

0 comments on commit 4028468

Please sign in to comment.