Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ jobs:
LETSENCRYPT_EMAIL=${{ env.LETSENCRYPT_EMAIL }}
IMAGE_REF=${{ env.IMG }}
DOCKERHUB_USERNAME=${{ secrets.DOCKERHUB_USERNAME }}
PUSH_TOKEN=${{ secrets.PUSH_TOKEN }}
EOT
EOF

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/flask_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
uses: actions/checkout@v3

- name: Build & start services
env:
PUSH_TOKEN: ${{ secrets.PUSH_TOKEN }}
run: |
docker compose up -d --build
# give the app a moment to start
Expand All @@ -26,4 +28,4 @@ jobs:

- name: Tear down
if: always()
run: docker compose down --volumes --remove-orphans
run: docker compose down --volumes --remove-orphans
4 changes: 3 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
app = Flask(__name__)

DB_PATH = "candles.db"
PUSH_TOKEN = "여기에_긴랜덤토큰_32자이상"
PUSH_TOKEN = os.environ.get("PUSH_TOKEN")
if not PUSH_TOKEN:
raise RuntimeError("PUSH_TOKEN not set")

def init_db():
conn = sqlite3.connect(DB_PATH)
Expand Down
1 change: 1 addition & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
image: ${IMAGE_REF}
environment: # <- 매핑 형식
FLASK_ENV: production
PUSH_TOKEN: ${PUSH_TOKEN}
expose:
- "5000"
restart: unless-stopped
Expand Down
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ services:
build: .
ports:
- 5000:5000
environment:
- FLASK_ENV=development
environment:
FLASK_ENV: development
PUSH_TOKEN: ${PUSH_TOKEN:-ci_dummy_token}

nginx:
image: nginx:alpine
Expand All @@ -13,4 +14,4 @@ services:
depends_on:
- web
volumes:
- ./nginx:/etc/nginx/conf.d:ro
- ./nginx:/etc/nginx/conf.d:ro
Loading