Last active
March 16, 2020 16:10
-
-
Save asadlive84/5d6c9199c46003555eb07effc0681760 to your computer and use it in GitHub Desktop.
Revisions
-
asadlive84 revised this gist
Mar 16, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,6 +15,7 @@ ENV PYTHONUNBUFFERED 1 COPY requirements.txt /code/requirements.txt WORKDIR /code RUN pip install psycopg2-binary RUN pip install -r requirements.txt -
asadlive84 revised this gist
Mar 16, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ sudo docker build . sudo docker-compose up sudo docker-compose down sudo docker-compose -d --build sudo docker-compose exec web python manage.py migrate sudo docker exec web [cmd] -
asadlive84 revised this gist
Mar 16, 2020 . 1 changed file with 19 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -51,3 +51,22 @@ services: volumes: postgres_data: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'postgres', 'USER': 'postgres', 'PASSWORD': 'postgres', 'HOST': 'db', 'PORT': '5432', } } -
asadlive84 created this gist
Mar 12, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,53 @@ sudo docker build . sudo docker-compose up sudo docker-compose down sudo docker-compose -d --build sudo docker exec web python manage.py migrate sudo docker exec web [cmd] FROM python:3.7-slim ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 COPY requirements.txt /code/requirements.txt WORKDIR /code RUN pip install -r requirements.txt COPY . /code/ docker compose version: '3.3' services: web: build: . command: python /code/manage.py runserver 0.0.0.0:8000 volumes: - .:/code ports: - 8000:8000 depends_on: - db db: image: postgres:11 restart: always environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: postgres volumes: - postgres_data:/var/lib/postgresql/data/ volumes: postgres_data: