Skip to content

Commit

Permalink
Feat : docker initialised : backend (#101)
Browse files Browse the repository at this point in the history
* docker initialised: backend

* changes

* changes
  • Loading branch information
ChaudharyRaman authored Nov 16, 2023
1 parent 18dbbd7 commit ab0c789
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
venv
8 changes: 8 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM python:3.10-alpine
WORKDIR /usr/src/app
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN pip install --upgrade pip
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
3 changes: 2 additions & 1 deletion backend/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['*']
# ALLOWED_HOSTS = os.environ.get('DJANGO_ALLOWED_HOSTS').split(' ')

CORS_ORIGIN_ALLOW_ALL = False
CORS_ORIGIN_WHITELIST = ['http://localhost:3000', ]
Expand Down
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: "3.8"
services:
backend:
# restart: always
container_name: django
build:
context: ./backend
command: python manage.py runserver 0.0.0.0:8000
ports:
- 8000:8000
volumes:
- ./backend/:/usr/src/app/
environment:
- DEBUG=1
- SECRET_KEY=35%fnl)_3v67^9os3%5bo+vv)$l&a6k#_&21i-xl7%_%#sa5(v
- DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1

0 comments on commit ab0c789

Please sign in to comment.