Skip to content

Commit 723bd92

Browse files
authored
Merge pull request #471 from LightOfHeaven1994/fix-local-dev-setup
Fix local dev setup
2 parents c7f999f + bedd246 commit 723bd92

File tree

6 files changed

+31
-14
lines changed

6 files changed

+31
-14
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
args: [ --allow-multiple-documents ]
1818
- id: debug-statements
1919
- repo: https://github.com/pycqa/flake8
20-
rev: 5.0.4
20+
rev: 6.1.0
2121
hooks:
2222
- id: flake8
2323
args: [--max-line-length, "100", --ignore, "E203, W503"]

backend/ibutsu_server/db/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def password(self):
238238
return self._password
239239

240240
@password.setter
241-
def password_set(self, value):
241+
def password(self, value):
242242
self._password = bcrypt.generate_password_hash(value).decode("utf8")
243243

244244
def check_password(self, plaintext):

backend/ibutsu_server/db/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ def add_superadmin(
5656
user = models.User(
5757
email=email,
5858
name=name,
59-
password=password,
6059
is_superadmin=True,
6160
is_active=True,
6261
)
62+
user.password = password
6363

6464
session.add(user)
6565

backend/ibutsu_server/openapi/openapi.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,6 +1387,7 @@ paths:
13871387
summary: Get a general health report
13881388
tags:
13891389
- health
1390+
security: []
13901391
x-openapi-router-controller: ibutsu_server.controllers.health_controller
13911392
/health/database:
13921393
get:

backend/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
REQUIRES = [
77
"alembic",
88
"celery",
9-
"connexion",
9+
"connexion[swagger-ui]==2.14.2",
1010
"flask_bcrypt",
1111
"flask_cors",
1212
"flask_mail",

docker-compose.dev.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ services:
99
working_dir: /mnt
1010
user: ${UID:-1000}
1111
volumes:
12-
- "./frontend:/mnt"
12+
- "./frontend:/mnt:z"
1313
ports:
1414
- "3000:3000"
1515
depends_on:
16-
- backend
16+
backend:
17+
condition: service_healthy
1718
backend:
1819
environment:
1920
- JWT_SECRET=jwtsecret
@@ -32,13 +33,20 @@ services:
3233
command: /bin/bash -c 'python -m venv .backend_env && source .backend_env/bin/activate && pip install -U pip setuptools wheel && pip install -r requirements.txt && python -m ibutsu_server --host 0.0.0.0'
3334
working_dir: /mnt
3435
volumes:
35-
- "./backend:/mnt"
36+
- "./backend:/mnt:z"
3637
user: ${UID:-1000}
3738
ports:
3839
- "8080:8080"
3940
depends_on:
40-
- postgres
41-
- redis
41+
postgres:
42+
condition: service_healthy
43+
redis:
44+
condition: service_started
45+
healthcheck:
46+
test: curl --output /dev/null --silent --head --fail http://localhost:8080/api/health
47+
interval: 10s
48+
timeout: 10s
49+
retries: 5
4250
worker:
4351
environment:
4452
- COLUMNS=80
@@ -54,17 +62,25 @@ services:
5462
command: /bin/bash -c 'python -m venv .worker_env && source .worker_env/bin/activate && pip install -U pip setuptools wheel && pip install -r requirements.txt && ./celery_worker.sh'
5563
working_dir: /mnt
5664
volumes:
57-
- "./backend:/mnt"
65+
- "./backend:/mnt:z"
5866
user: ${UID:-1000}
5967
depends_on:
60-
- backend
61-
- postgres
62-
- redis
68+
postgres:
69+
condition: service_healthy
70+
redis:
71+
condition: service_started
72+
backend:
73+
condition: service_healthy
6374
postgres:
6475
environment:
6576
POSTGRES_USER: ibutsu
6677
POSTGRES_PASSWORD: ibutsu
6778
POSTGRES_DB: ibutsu
68-
image: postgres:14
79+
image: postgres:15
80+
healthcheck:
81+
test: [ "CMD-SHELL", "pg_isready -U ibutsu" ]
82+
interval: 5s
83+
timeout: 5s
84+
retries: 5
6985
redis:
7086
image: redis:latest

0 commit comments

Comments
 (0)