Skip to content

Commit 465fb21

Browse files
2 parents 3fc70de + ec4bc16 commit 465fb21

File tree

3 files changed

+44
-18
lines changed

3 files changed

+44
-18
lines changed

.github/workflows/docker.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
type=semver,pattern={{major}}.{{minor}}
9898
type=semver,pattern={{major}}
9999
type=sha
100-
type=raw,value=latest,enable={{is_default_branch}}
100+
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch || 'main') }}
101101
102102
- name: Setup QEMU
103103
uses: docker/setup-qemu-action@v3
@@ -110,6 +110,7 @@ jobs:
110110
with:
111111
context: .
112112
file: ./${{ matrix.dockerfile }}
113+
push: ${{ github.event_name != 'pull_request' }}
113114
tags: ${{ steps.meta.outputs.tags }}
114115
labels: ${{ steps.meta.outputs.labels }}
115116
cache-from: type=registry,ref=${{ env.REGISTRY_URL }}/${{ env.REGISTRY_USER }}/${{ steps.image_name.outputs.IMAGE }}:buildcache

.pre-commit-config.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@ fail_fast: true
22

33
repos:
44
- repo: https://github.com/astral-sh/ruff-pre-commit
5-
rev: v0.6.1
5+
rev: v0.7.1
66
hooks:
77
- id: ruff
88
args: [--fix, --exit-non-zero-on-fix]
9+
- repo: https://github.com/pre-commit/mirrors-mypy
10+
rev: v1.13.0
11+
hooks:
12+
- id: mypy
13+
args: [--ignore-missing-imports]
14+
additional_dependencies: [tokenize-rt]
915
- repo: https://github.com/pre-commit/pre-commit-hooks
10-
rev: v4.6.0
16+
rev: v5.0.0
1117
hooks:
1218
- id: check-added-large-files
1319
args: ['--maxkb=1024']

process-compose.yml

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,45 @@ is_strict: true
1414
disable_env_expansion: true
1515

1616
processes:
17-
redis:
17+
flask:
18+
command: flask --app main run
19+
working_dir: ./app
20+
environment:
21+
- FLASK_APP=main
22+
- FLASK_DEBUG=True
23+
depends_on:
24+
db:
25+
condition: "process_started"
26+
availability:
27+
restart: "always"
28+
backoff_seconds: 5 # default: 1
29+
max_restarts: 0 # default: 0 (unlimited)
30+
31+
db:
1832
command: >
1933
docker run --rm -d \
20-
--name "${NAME:-devbox-redis}" \
21-
-p "${PORT:-6379}:6379" \
22-
"redis:${VERSION:-6.2}-alpine"
34+
--name ${CONTAINER_NAME} \
35+
-e POSTGRES_INITDB_ARGS="--locale-provider=icu --icu-locale=en_US.UTF-8" \
36+
-e POSTGRES_DB=${POSTGRES_DB} \
37+
-e POSTGRES_USER=${POSTGRES_USER} \
38+
-e POSTGRES_PASSWORD=${POSTGRES_PASSWORD} \
39+
-p ${PORT}:5432 \
40+
postgres:${VERSION}-alpine3.20
2341
is_daemon: true
24-
environment: null
42+
is_tty: false
43+
environment:
44+
- CONTAINER_NAME=${CONTAINER_NAME:-devbox-postgres}
45+
- VERSION=${VERSION:-16.3}
46+
- PORT=${PORT:-5432}
47+
- POSTGRES_DB=${DB_NAME:-postgres}
48+
- POSTGRES_USER=${DB_USER:-postgres}
49+
- POSTGRES_PASSWORD=${DB_PASS?}
2550
readiness_probe:
2651
exec:
2752
command: >
28-
timeout 12s bash -c \
29-
"until echo PING \
30-
| nc -z localhost ${PORT:-6379} \
31-
; do sleep 1 \
53+
timeout 30s bash -c \
54+
"until docker exec ${CONTAINER_NAME} pg_isready \
55+
; do sleep 3 \
3256
; done"
33-
availability:
34-
exit_on_end: true
35-
is_tty: false
3657
shutdown:
37-
command: "docker stop ${NAME:-devbox-redis}"
38-
timeout_seconds: 10 # default: 10
39-
signal: 15 # default: 15
58+
command: "docker stop ${CONTAINER_NAME}"

0 commit comments

Comments
 (0)