Skip to content

Commit 9545e10

Browse files
authored
Merge pull request #188 from pirogramming/develop
최종 merge
2 parents 4f61b8f + 5dc0a2f commit 9545e10

225 files changed

Lines changed: 25165 additions & 9 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# PostgreSQL 데이터베이스 설정
2+
# 팀원들이 각자 자신의 PostgreSQL 사용자명과 설정에 맞게 수정해야 합니다
3+
DB_ENGINE=django.db.backends.postgresql
4+
DB_NAME=kitup
5+
DB_USER=your_postgres_user # 수정 필요: 자신의 PostgreSQL 사용자명으로 변경
6+
DB_PASSWORD= # 수정 필요: PostgreSQL 비밀번호 입력 (없으면 비워두기)
7+
DB_HOST=localhost
8+
DB_PORT=5432
9+
10+
# Django 설정
11+
SECRET_KEY=your-secret-key-here # 수정 필요: 실제 SECRET_KEY로 변경
12+
DEBUG=True
13+
ALLOWED_HOSTS=localhost,127.0.0.1
14+
15+
# Allauth 설정
16+
SITE_ID=1
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: 🐛 Bug Report
3+
about: 기능 오류, API 에러, 로직 이상 등 버그 제보
4+
title: "[Bug] "
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
## 📌 버그 설명
10+
무엇이 잘못 동작하는지 간단히 작성
11+
12+
## 📍 발생 위치
13+
API: ``
14+
15+
## 🔁 재현 방법
16+
1.
17+
2.
18+
3.
19+
20+
## ❗ 실제 결과
21+
에러 메시지 또는 로그
22+
23+
## ✅ 기대 결과
24+
정상 동작 설명

.github/ISSUE_TEMPLATE/feature.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: Feature
3+
about: 새로운 기능 추가 / 개선
4+
title: "[Feat] "
5+
labels: ["feature"]
6+
assignees: []
7+
---
8+
9+
## 📌 작업 범위
10+
<!-- 이번 이슈에서 다룰 작업을 작성 -->
11+
- [ ]
12+
13+
## ✅ TODO
14+
<!-- 이 이슈가 끝났다고 판단할 기준 -->
15+
- [ ]
16+
17+
## 📝 참고 사항
18+
<!-- API, ERD, 화면 캡처, 논의된 내용 등 (선택) -->

.github/pull_request_template.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## 🔥 작업 내용
2+
<!-- 이 PR에서 무엇을 했는지 요약 -->
3+
4+
## 🔗 연관 이슈
5+
<!-- closes / resolves / fixes 중 하나 사용 -->
6+
- resolves #
7+
8+
## ⚠️ 참고 사항
9+
<!-- 리뷰 시 유의할 점 / 고민했던 부분 -->

.github/workflows/deploy.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Deploy to EC2 with GHCR
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Log in to GHCR
20+
uses: docker/login-action@v3
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Build and push Docker image
27+
uses: docker/build-push-action@v5
28+
with:
29+
context: .
30+
push: true
31+
tags: ghcr.io/pirogramming/startlinedev/web:latest
32+
# 빌드 시 캐시로 인한 0바이트 파일 생성을 방지하고 싶다면 아래 옵션을 추가할 수 있습니다.
33+
# no-cache: true
34+
35+
deploy:
36+
needs: build-and-push
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Deploy to EC2 via SSH
40+
uses: appleboy/ssh-action@v1.0.3
41+
with:
42+
host: ${{ secrets.EC2_HOST }}
43+
username: ubuntu
44+
key: ${{ secrets.EC2_SSH_KEY }}
45+
script: |
46+
cd ~/kitup
47+
# 서버에서도 GHCR 이미지를 받을 수 있게 로그인
48+
echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
49+
50+
# 1. 기존의 <none> 태그 이미지(Dangling Images)를 정리하여 용량 확보 및 이미지 꼬임 방지
51+
docker image prune -f
52+
53+
# 2. 최신 이미지 가져오기
54+
docker-compose pull web
55+
56+
# 3. 컨테이너 재실행
57+
docker-compose up -d web
58+
59+
# 4. 배포 직후 다시 한번 정리 (선택사항이지만 서버를 깨끗하게 유지해줍니다)
60+
docker image prune -f
61+
62+
# 5. 후처리 작업 (DB 동기화 및 정적파일 수집)
63+
# 컨테이너가 뜰 시간을 잠깐 주기 위해 sleep을 넣는 것도 안정적입니다.
64+
sleep 3
65+
docker-compose exec -T web python manage.py migrate
66+
docker-compose exec -T web python manage.py collectstatic --noinput

.gitignore

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ local_settings.py
1616
settings_local.py
1717

1818
# Django media & static (선택)
19-
media/
2019
staticfiles/
2120

2221
############################
@@ -35,15 +34,10 @@ env/
3534
ENV/
3635
pip-wheel-metadata/
3736

38-
############################
39-
# Django collectstatic
40-
############################
41-
static/
42-
4337
############################
4438
# Docker
4539
############################
46-
docker-compose.override.yml
40+
#docker-compose.override.yml
4741
*.tar
4842
*.log
4943

@@ -87,3 +81,11 @@ htmlcov/
8781
# 기타
8882
############################
8983
.cache/
84+
/media/
85+
86+
87+
*.pem
88+
kitup-key.pem
89+
90+
# AI용 프로젝트 압축 파일
91+
*.zip

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM python:3.12-slim
2+
3+
WORKDIR /app
4+
5+
# system dependencies
6+
RUN apt-get update && apt-get install -y \
7+
postgresql-client \
8+
build-essential \
9+
&& rm -rf /var/lib/apt/lists/*
10+
11+
# python deps
12+
COPY requirements.txt .
13+
RUN pip install --no-cache-dir -r requirements.txt
14+
15+
# project files
16+
COPY . .
17+
18+
# static / media
19+
RUN mkdir -p /app/staticfiles /app/media
20+
21+
EXPOSE 8000
22+
23+
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]

Dockerrun.aws.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"AWSEBDockerrunVersion": "1",
3+
"Image": {
4+
"Name": "bimvocado/kitup-web:latest",
5+
"Update": "true"
6+
},
7+
"Ports": [
8+
{
9+
"ContainerPort": 8000
10+
}
11+
]
12+
}

FETCH_H

Whitespace-only changes.

FETCH_HEAD

Whitespace-only changes.

0 commit comments

Comments
 (0)