-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/deployment script #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zzjc1234
wants to merge
75
commits into
dev
Choose a base branch
from
feat/deployment-script
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
dee2445
chore: dev init
zzjc1234 d157917
feat: auto deploy
zzjc1234 ffb777b
fix: dev.sh
zzjc1234 60a0a99
feat: docker compose tested
zzjc1234 0cc296a
Merge branch 'dev' into feat/deployment-script
zzjc1234 18b0a45
chore: use polling instead of sleep and update doc
A-lexisL 205fecc
chore(Dockerfile): Use Python 3.13 and Debian 13
PACHAKUTlQ b3a29d2
Merge branch 'dev' into feat/deployment-script
zzjc1234 0e53795
chore(scripts): reorganzie path of scripts
zzjc1234 e249863
fix(docker): backend deployment with docker
zzjc1234 62fee0c
Merge branch 'dev' into feat/deployment-script
zzjc1234 3c1be34
feat: podman support
zzjc1234 f9d855c
feat: deploy with wsgi
zzjc1234 6b8cd9e
feat: distroless support
zzjc1234 f937496
chore: rm old shell script
zzjc1234 a01539a
fix: dependency
zzjc1234 10ae7f8
fix: ruff check
zzjc1234 e24ef16
fix: make podman stack run backend and frontend
zzjc1234 197e794
chore: update dependencies
zzjc1234 3308db1
chore: rm docker compose
zzjc1234 28c5828
chore: upgrade container version
zzjc1234 0a49eea
fix: rm docker compability
zzjc1234 0975000
fix: rm docker keywords
zzjc1234 ce25e95
fix: rm non ascii
zzjc1234 8df3106
chore: use the setup on the dev branch
zzjc1234 a373e43
fix: use uv instead of python3
zzjc1234 2a2be4b
chore: rewind submodule
zzjc1234 597267f
chore: use uv instead of python 3
zzjc1234 2d65641
chore: migrate create_admin and entrypoint
zzjc1234 71e44ee
chore: update compose
zzjc1234 b3327c2
chore: add gunicorn
zzjc1234 c901e49
fix(podman)!: Use env for credentials
PACHAKUTlQ c5cb3f6
fix(setup): Change non-exist `is_admin` to `is_superuser`
PACHAKUTlQ f2e70ca
style(dev): Format dev.sh
PACHAKUTlQ e191212
fix: Use relative paths for entrypoint script as convention
PACHAKUTlQ 309f8c3
feat(podman)!: Rename Dockerfile to Containerfile
PACHAKUTlQ cc42c81
chore(podman): Add .containerignore
PACHAKUTlQ cd02f26
fix(setup)!: Remove static file collections
PACHAKUTlQ 48dd31b
fix(setup)!: Install all dependencies groups like dev and lint
PACHAKUTlQ 4cc6fd6
fix(setup): Add executable permission to dev.sh
PACHAKUTlQ 34e890e
chore: add STATIC_ROOT env
A-lexisL 12c698d
revert: adding STATIC_ROOT
A-lexisL b1aebcc
chore: Remove unused podman-compose
PACHAKUTlQ c601933
feat(setup): Support redirecting all output to both stdout and a log …
PACHAKUTlQ 20b8f6d
fix(podman): Set default `DB_HOST` as `localhost`
PACHAKUTlQ 7a2fef3
fix(setup): Only copy .env when no existing one
PACHAKUTlQ 5574396
fix(podman)!: Remove unused frontend container
PACHAKUTlQ 9b44db1
fix(podman)!: Enable Containerfile in podman-compose.yaml
PACHAKUTlQ 35a6eb0
fix(setup)!: Use `valkey-cli` instead of `redis-cli`
PACHAKUTlQ b4c25f8
fix(podman): Respect env in postgres healthcheck
PACHAKUTlQ f32e1fd
fix!: Use `REDIS__URL` instead of `REDIS_URL` for consistency
PACHAKUTlQ cc61c0c
style(podman): Use dictionary instead of list
PACHAKUTlQ 3a92304
fix(podman): Run python in unbuffered output mode for real time logging
PACHAKUTlQ d02e998
Revert "fix(podman): Set default `DB_HOST` as `localhost`"
PACHAKUTlQ a314977
fix(podman)!: Postgres use data/ dir
PACHAKUTlQ e71f114
fix(podman)!: Remove unused database env variables
PACHAKUTlQ ad2ade8
fix!: Use container name as host in .env file to make postgres happy
PACHAKUTlQ b19e5ab
fix(podman): Create gunicorn socket in /tmp instead of /app due to pe…
PACHAKUTlQ 17d9ca2
fix(podman): Use `python` instead of `python3`
PACHAKUTlQ 72bcbe9
fix(podman): Use `python` instead of `python3`
PACHAKUTlQ d598370
fix(podman): Podman ignore config.yaml
PACHAKUTlQ 3888efa
fix(podman)!: Build with uv trixie image
PACHAKUTlQ 257493e
chore: Update dependencies
PACHAKUTlQ ed721fa
fix! Remove scripts/dev.sh and Makefile
PACHAKUTlQ aa293bb
fix! Rename manage.py to django_manage.py to avoid confusion
PACHAKUTlQ 3e1b61c
fix(podman)!: Stop running migrations in podman entrypoint script
PACHAKUTlQ 44a67aa
refactor(podman)!: Use different compose file for using podman in dev…
PACHAKUTlQ 44a0818
feat: Use an unified script for managing everything
PACHAKUTlQ ece4880
ci: Ignore the control script
PACHAKUTlQ ba841d3
style(run): Add new line before return and after exception to satisfy…
PACHAKUTlQ 8470be2
fix(run): Fix mixed program name
PACHAKUTlQ 745c5d3
fix(run): Normalize host to adapt to both podman and django requirements
PACHAKUTlQ e053469
ci(hook)!: Add more git hooks
PACHAKUTlQ b082ef1
ci(hook): Update ruff pre-commit hook version
PACHAKUTlQ 96123f4
fix(hook)!: Pin python version to 3.14 to force prek check 3.14 AST
PACHAKUTlQ File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| config.yaml | ||
| run.py | ||
| .git | ||
| .venv | ||
| .env | ||
| .ruff_cache | ||
| frontend | ||
| .github | ||
| docs | ||
| Makefile | ||
| .pre-commit-config.yaml | ||
| LICENSE | ||
| .gitignore | ||
| .containerignore | ||
| .gitmodules | ||
| podman-compose.yaml | ||
| __pycache__ | ||
| *.py[codz] | ||
| **/__pycache__ | ||
| **/*.py[codz] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| FROM ghcr.io/astral-sh/uv:python3.14-trixie-slim AS builder | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY . /app | ||
|
|
||
| RUN UV_PROJECT_ENVIRONMENT=/usr/local \ | ||
| uv sync --project=/app --frozen --compile-bytecode --no-dev --no-editable --no-managed-python | ||
|
|
||
| FROM gcr.io/distroless/base-debian13:nonroot | ||
PACHAKUTlQ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| COPY --from=builder /usr/local /usr/local | ||
|
|
||
| COPY --from=builder /app /app | ||
PACHAKUTlQ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| WORKDIR /app | ||
|
|
||
| USER nonroot | ||
|
|
||
| ENTRYPOINT ["python", "scripts/entrypoint.py"] | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| services: | ||
| db: | ||
| ports: | ||
| - "5432:5432" | ||
|
|
||
| cache: | ||
| ports: | ||
| - "6379:6379" | ||
|
|
||
| backend: | ||
| build: | ||
| context: . | ||
| dockerfile: Containerfile | ||
| ports: | ||
| - "8000:8000" | ||
| env_file: | ||
| - .env | ||
| environment: | ||
| DATABASE__URL: ${DATABASE__URL:-postgres://admin:test@db:5432/coursereview} | ||
| REDIS__URL: ${REDIS__URL:-redis://cache:6379/0} | ||
| volumes: | ||
| - ./config.yaml:/app/config.yaml:ro | ||
|
|
||
| migrate: | ||
| build: | ||
| context: . | ||
| dockerfile: Containerfile | ||
| env_file: | ||
| - .env | ||
| environment: | ||
| DATABASE__URL: ${DATABASE__URL:-postgres://admin:test@db:5432/coursereview} | ||
| REDIS__URL: ${REDIS__URL:-redis://cache:6379/0} | ||
| volumes: | ||
| - ./config.yaml:/app/config.yaml:ro |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| services: | ||
| backend: | ||
| ports: | ||
| - "8000:8000" | ||
| env_file: | ||
| - /etc/coursereview/secrets.env | ||
| environment: | ||
| DATABASE__URL: ${DATABASE__URL:-postgres://admin:test@db:5432/coursereview} | ||
| REDIS__URL: ${REDIS__URL:-redis://cache:6379/0} | ||
| volumes: | ||
| - /etc/coursereview/config.yaml:/app/config.yaml:ro | ||
|
|
||
| migrate: | ||
| env_file: | ||
| - /etc/coursereview/secrets.env | ||
| environment: | ||
| DATABASE__URL: ${DATABASE__URL:-postgres://admin:test@db:5432/coursereview} | ||
| REDIS__URL: ${REDIS__URL:-redis://cache:6379/0} | ||
| volumes: | ||
| - /etc/coursereview/config.yaml:/app/config.yaml:ro |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| services: | ||
| db: | ||
| image: postgres:18-alpine | ||
| volumes: | ||
| - postgres18_data:/var/lib/postgresql/data | ||
| environment: | ||
| POSTGRES_DB: ${POSTGRES_DB:-coursereview} | ||
| POSTGRES_USER: ${POSTGRES_USER:-admin} | ||
| POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-test} | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-admin} -d ${POSTGRES_DB:-coursereview}"] | ||
| interval: 10s | ||
| timeout: 5s | ||
| retries: 5 | ||
| restart: unless-stopped | ||
|
|
||
| cache: | ||
| image: valkey/valkey:9-alpine | ||
| healthcheck: | ||
| test: ["CMD", "valkey-cli", "ping"] | ||
PACHAKUTlQ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| interval: 10s | ||
| timeout: 5s | ||
| retries: 5 | ||
| restart: unless-stopped | ||
PACHAKUTlQ marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| backend: | ||
| image: coursereview-backend | ||
| depends_on: | ||
| db: | ||
| condition: service_healthy | ||
| cache: | ||
| condition: service_healthy | ||
| environment: | ||
| PYTHONUNBUFFERED: "1" | ||
| GUNICORN_CMD_ARGS: "--control-socket /tmp/gunicorn.ctl --worker-tmp-dir /tmp" | ||
| healthcheck: | ||
| test: | ||
| [ | ||
| "CMD", | ||
| "python", | ||
| "-c", | ||
| "__import__('urllib.request').request.urlopen('http://127.0.0.1:8000/api/user/status/',timeout=5)", | ||
| ] | ||
| interval: 15s | ||
| timeout: 5s | ||
| retries: 5 | ||
| start_period: 20s | ||
| restart: unless-stopped | ||
|
|
||
| migrate: | ||
| image: coursereview-backend | ||
| depends_on: | ||
| db: | ||
| condition: service_healthy | ||
| environment: | ||
| PYTHONUNBUFFERED: "1" | ||
| command: ["python", "django_manage.py", "migrate"] | ||
| restart: "no" | ||
|
|
||
| volumes: | ||
| postgres18_data: | ||
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.