Compare commits

1 Commits
main ... rework

Author SHA1 Message Date
7abb819e76 ++ 2026-03-25 12:39:54 +01:00
6 changed files with 76 additions and 63 deletions

View File

@@ -1,28 +1,28 @@
ESI_CLIENT_ID=
ESI_SECRET_KEY=
ESI_CALLBACK_URL=
ESI_USER_AGENT=
ESI_CLIENT_ID=placeholder-client-id
ESI_SECRET_KEY=placeholder-secret-key
ESI_CALLBACK_URL=http://localhost:8000/esi/callback/
ESI_USER_AGENT=marbas-dev-agent
REDIS_URL=
REDIS_PORT=
REDIS_DB=
REDIS_URL=redis
REDIS_PORT=6379
REDIS_DB=0
REDIS_PASSWORD=
REDIS_USER=
SQLITE_DB_PATH=
POSTGRES_HOST=
POSTGRES_PORT=
POSTGRES_PASSWORD=
POSTGRES_USER=
POSTGRES_DB=
SQLITE_DB_PATH=db.sqlite3
POSTGRES_HOST=db
POSTGRES_PORT=5432
POSTGRES_PASSWORD=marbas
POSTGRES_USER=marbas
POSTGRES_DB=marbas
DRF_SECRET_KEY=
DRF_DEBUG=
DEBUG=
ALLOWED_HOSTS=
CORS_ALLOWED_ORIGINS=
CSRF_TRUSTED_ORIGINS=
DRF_SECRET_KEY=django-insecure-dev-key-change-me
DRF_DEBUG=True
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1,0.0.0.0
CORS_ALLOWED_ORIGINS=http://localhost:8000,http://127.0.0.1:8000
CSRF_TRUSTED_ORIGINS=http://localhost:8000,http://127.0.0.1:8000
OIDC_RP_CLIENT_ID=
OIDC_WELLKNOWN=
OIDC_CACHE_USERINFO=
OIDC_RP_CLIENT_ID=placeholder-oidc-client-id
OIDC_WELLKNOWN=https://login.eveonline.com/.well-known/openid-configuration
OIDC_CACHE_USERINFO=True

View File

@@ -6,14 +6,13 @@ ENV PYTHONDONTWRITEBYTECODE=1
RUN adduser -u 5678 --disabled-password --gecos "" appuser
WORKDIR /app
COPY --chown=appuser:appuser manage.py /app/manage.py
COPY requirements.txt .
RUN python -m pip install --no-cache-dir --upgrade -r requirements.txt
COPY --chown=appuser:appuser marbas /app/marbas
COPY --chown=appuser:appuser sde /app/sde
COPY --chown=appuser:appuser api /app/api
COPY --chown=appuser:appuser authentication /app/authentication
#COPY --chown=appuser:appuser static /app/static
RUN mkdir -p /app/static && chown appuser:appuser /app/static
COPY --chown=appuser:appuser . /app
USER appuser
EXPOSE 8000

9
api/tasks.py Normal file
View File

@@ -0,0 +1,9 @@
from celery import Celery
app = Celery(
'prod',
broker='redis://localhost:6379/0'
)
if __name__ == '__main__':
app.start()

View File

@@ -90,7 +90,9 @@ def reprocess_eval(request):
ep_items = request.data.get("ep_items")
efficiency = request.data.get("efficiency", 0.55)
matprices = {item["typeID"]: {'sell': item["prices"]["sell"]["min"], 'buy': item["prices"]["buy"]["max"]} for item in ep_mat['items']}
matprices = {item["typeID"]: {'sell': item["prices"]["sell"]["min"],
'buy': item["prices"]["buy"]["max"]}
for item in ep_mat['items']}
item_reprocess = []
for rawitem in ep_items["items"]:

View File

@@ -1,42 +1,33 @@
services:
migrations:
app_base: &app_base
image: marbas:local
build:
context: .
dockerfile: Dockerfile
env_file:
- .env
user: "1000:1000"
user: "${UID:-1000}:${GID:-1000}"
volumes:
- ./marbas:/app/marbas
- ./api:/app/api
- ./sde:/app/sde
- ./authentication:/app/authentication
- ./manage.py:/app/manage.py
- ./static:/app/static
command: sh -c "python manage.py makemigrations && python manage.py migrate"
- .:/app:z
depends_on:
db:
condition: service_healthy
migrations:
<<: *app_base
command: sh -c "python manage.py makemigrations && python manage.py migrate"
import_sde:
<<: *app_base
command: python manage.py import_sde /app/static_eve/sde/fsd
depends_on:
migrations:
condition: service_completed_successfully
eveal:
image: marbas:local
build:
context: .
dockerfile: Dockerfile
env_file:
- .env
<<: *app_base
ports:
- "8000:8000"
user: "1000:1000"
volumes:
- ./marbas:/app/marbas
- ./api:/app/api
- ./sde:/app/sde
- ./authentication:/app/authentication
- ./manage.py:/app/manage.py
- ./static_eve:/app/static_eve
- ./static:/app/static
command: ["uvicorn", "marbas.asgi:application", "--host", "0.0.0.0", "--port", "8000", "--reload"]
healthcheck:
test: python manage.py health_check
@@ -48,8 +39,19 @@ services:
condition: service_healthy
migrations:
condition: service_completed_successfully
# elasticsearch:
# condition: service_healthy
import_sde:
condition: service_completed_successfully
worker:
<<: *app_base
command: celery -A marbas worker -l info
depends_on:
redis:
condition: service_healthy
db:
condition: service_healthy
migrations:
condition: service_completed_successfully
redis:
image: redis:latest
@@ -64,7 +66,7 @@ services:
ports:
- "5432:5432"
volumes:
- marbas_dbdata:/var/lib/postgresql/data
- marbas_dbdata:/var/lib/postgresql/data:Z
env_file:
- .env
healthcheck:

View File

@@ -14,3 +14,4 @@ django-health-check
mozilla-django-oidc
django-cors-headers
whitenoise
celery