diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6ab5314 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3.9 + +WORKDIR /postit + +COPY requirements.txt . + +RUN pip install -r requirements.txt + +EXPOSE 8000 + +CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 0000000..b3535b7 --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,26 @@ +services: + db: + image: postgres + environment: + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + env_file: + - .env + web: + build: . + command: python manage.py runserver 0.0.0.0:8000 + volumes: + - .:/postit + ports: + - "8000:8000" + depends_on: + - db + environment: + - SECRET_KEY=${SECRET_KEY} + - DB_NAME=${DB_NAME} + - DB_USER=${DB_USER} + - DB_PASSWORD=${DB_PASSWORD} + - DB_HOST=${DB_HOST} + - DB_PORT=${DB_PORT} + env_file: + - .env + tty: true diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..0276063 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,22 @@ +services: + db: + image: postgres + environment: + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + web: + build: . + command: python manage.py runserver 0.0.0.0:8000 + volumes: + - .:/postit + ports: + - "8000:8000" + depends_on: + - db + environment: + - SECRET_KEY=${SECRET_KEY} + - DB_NAME=${DB_NAME} + - DB_USER=${DB_USER} + - DB_PASSWORD=${DB_PASSWORD} + - DB_HOST=${DB_HOST} + - DB_PORT=${DB_PORT} + tty: true diff --git a/post_it_backend/settings.py b/post_it_backend/settings.py index 4d681ee..ce985c9 100644 --- a/post_it_backend/settings.py +++ b/post_it_backend/settings.py @@ -17,7 +17,6 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) env = environ.Env() -environ.Env.read_env(env_file=str(BASE_DIR) + '/.env') # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ diff --git a/requirements.txt b/requirements.txt index 99b9950..d34b032 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -django -djangorestframework -psycopg2 -django-environ -pylint -flake8 -pylint-django \ No newline at end of file +Django==4.2.6 +django-environ==0.11.2 +djangorestframework==3.14.0 +flake8==6.1.0 +psycopg2==2.9.9 +pylint==3.0.2 +pylint-django==2.5.5 \ No newline at end of file