도커 컴포즈 배포 도중 발생 - The SECRET_KEY setting must not be empty.

boingboing·2021년 12월 30일
0
        django:
                build:
                        context: .
                        dockerfile: Dockerfile
                container_name: django
                command: gunicorn my_project.wsgi:application --bind 0.0.0.0:8005
                volumes:
                        - ./soyeon_pj/static:/staticfiles
                        - ./nginx:/etc/nginx/conf.d
                expose:
                        - "8005"
                depends_on:
                        - maria_db
  • docker compose파일의 "장고" 컨테이너의 빌드 시점에 도커파일을 넣어 줌.
  • gunicorn으로 장고와 nginx를 연결함.
  • 현재 gunicorn 실행 커맨드는
    gunicorn my_project.wsgi:application --bind 0.0.0.0:8005

RUN apt-get install -y wget
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
    && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
    && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz

RUN ["chmod", "+x", "./docker-entrypoint.sh"]

ENTRYPOINT ["./docker-entrypoint.sh"]

도커파일에서 dockerize를 실행함.

원인

해당 에러는

if not settings.DEBUG and not settings.ALLOWED_HOSTS:

The SECRET_KEY setting must not be empty.

SECRET_KEY 세팅이 없다고 나옴 ???!!!

0개의 댓글