Skip to content

Commit

Permalink
feat: data.json -> ./data.json 으로 경로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
mmig01 committed Sep 28, 2024
1 parent efe642b commit 65a7c57
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/django_cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
python manage.py dumpdata > data.json && exit
# data.json 을 컨테이너 외부로 복사
sudo docker cp festival_backend_server:/app/data.json ./data.json && sudo docker rm festival_backend_server:/app/data.json
sudo docker cp festival_backend_server:/app/data.json ./data.json
# Docker 로그인 (토큰 사용)
echo "${{ secrets.DOCKER_TOKEN }}" | sudo docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
Expand All @@ -77,8 +77,8 @@ jobs:
# 5. 새로운 컨테이너 시작
sudo docker run --env-file 2024_fall_festival_back/.env -d -p 8000:8000 --name festival_backend_server ${{ secrets.DOCKER_USERNAME }}/festival_backend_image:latest
# data.json 파일을 복사
sudo docker cp ./data.json festival_backend_server:/app/data.json
# 6. Django 프로젝트의 static 파일 collect
sudo docker exec festival_backend_server python manage.py collectstatic --noinput
sudo docker exec festival_backend_server python manage.py collectstatic --noinput
# 7. SQLite 데이터 복원 (loaddata)
sudo docker exec festival_backend_server python manage.py loaddata ./data.json
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ COPY . .
RUN pip install gunicorn

# Django 마이그레이션 실행 후 Gunicorn으로 서버 시작
CMD ["sh", "-c", "python manage.py migrate && python manage.py loaddata /app/data.json && gunicorn --bind 0.0.0.0:8000 project.wsgi:application"]
CMD ["sh", "-c", "python manage.py migrate && gunicorn --bind 0.0.0.0:8000 project.wsgi:application"]

0 comments on commit 65a7c57

Please sign in to comment.