Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ COPY requirements.txt .

RUN pip install --upgrade pip
RUN pip install -r requirements.txt
RUN pip install django-redis
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requirements 에 적혀있는데 이거 빼도 되지 않나요??


# 소스 코드 복사
COPY . ./
Expand Down
10 changes: 9 additions & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
volumes:
- .:/backend
# command : 컨테이너가 띄워질 때 실행하는 명령어 / 서버실행
# command: sh -c "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
# command: sh -c "python manage.py makemigrations && python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
command: "gunicorn gtd.wsgi --preload --bind 0.0.0.0:8000 --timeout 240"
restart: on-failure
ports:
Expand Down Expand Up @@ -60,6 +60,14 @@ services:
networks:
- gtd

redis:
image: "redis:alpine"
container_name: redis
ports:
- 6379:6379
networks:
- gtd

# prometheus:
# image: prom/prometheus
# volumes:
Expand Down
13 changes: 12 additions & 1 deletion gtd/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,15 @@
'PATCH',
'POST',
'PUT',
)
)

# redis
CACHES = {
"default": {
"BACKEND": "django_redis.cache.RedisCache",
"LOCATION": "redis://redis:6379/1",
"OPTIONS": {
"CLIENT_CLASS": "django_redis.client.DefaultClient",
}
}
}
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ django-celery-results==2.5.1
gevent==23.9.1
openai==1.7.0
django-prometheus==2.3.1
gunicorn==21.2.0
gunicorn==21.2.0
redis==5.0.1