Skip to content

Commit

Permalink
Merge pull request #471 from LightOfHeaven1994/fix-local-dev-setup
Browse files Browse the repository at this point in the history
Fix local dev setup
  • Loading branch information
rsnyman authored Nov 28, 2023
2 parents c7f999f + bedd246 commit 723bd92
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
args: [ --allow-multiple-documents ]
- id: debug-statements
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
rev: 6.1.0
hooks:
- id: flake8
args: [--max-line-length, "100", --ignore, "E203, W503"]
Expand Down
2 changes: 1 addition & 1 deletion backend/ibutsu_server/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def password(self):
return self._password

@password.setter
def password_set(self, value):
def password(self, value):
self._password = bcrypt.generate_password_hash(value).decode("utf8")

def check_password(self, plaintext):
Expand Down
2 changes: 1 addition & 1 deletion backend/ibutsu_server/db/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ def add_superadmin(
user = models.User(
email=email,
name=name,
password=password,
is_superadmin=True,
is_active=True,
)
user.password = password

session.add(user)

Expand Down
1 change: 1 addition & 0 deletions backend/ibutsu_server/openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1387,6 +1387,7 @@ paths:
summary: Get a general health report
tags:
- health
security: []
x-openapi-router-controller: ibutsu_server.controllers.health_controller
/health/database:
get:
Expand Down
2 changes: 1 addition & 1 deletion backend/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
REQUIRES = [
"alembic",
"celery",
"connexion",
"connexion[swagger-ui]==2.14.2",
"flask_bcrypt",
"flask_cors",
"flask_mail",
Expand Down
36 changes: 26 additions & 10 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ services:
working_dir: /mnt
user: ${UID:-1000}
volumes:
- "./frontend:/mnt"
- "./frontend:/mnt:z"
ports:
- "3000:3000"
depends_on:
- backend
backend:
condition: service_healthy
backend:
environment:
- JWT_SECRET=jwtsecret
Expand All @@ -32,13 +33,20 @@ services:
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'
working_dir: /mnt
volumes:
- "./backend:/mnt"
- "./backend:/mnt:z"
user: ${UID:-1000}
ports:
- "8080:8080"
depends_on:
- postgres
- redis
postgres:
condition: service_healthy
redis:
condition: service_started
healthcheck:
test: curl --output /dev/null --silent --head --fail http://localhost:8080/api/health
interval: 10s
timeout: 10s
retries: 5
worker:
environment:
- COLUMNS=80
Expand All @@ -54,17 +62,25 @@ services:
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'
working_dir: /mnt
volumes:
- "./backend:/mnt"
- "./backend:/mnt:z"
user: ${UID:-1000}
depends_on:
- backend
- postgres
- redis
postgres:
condition: service_healthy
redis:
condition: service_started
backend:
condition: service_healthy
postgres:
environment:
POSTGRES_USER: ibutsu
POSTGRES_PASSWORD: ibutsu
POSTGRES_DB: ibutsu
image: postgres:14
image: postgres:15
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ibutsu" ]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:latest

0 comments on commit 723bd92

Please sign in to comment.