change docker entrypoint to clear content

This commit is contained in:
Zeecka
2025-12-31 05:28:58 +01:00
parent fc02dcab80
commit ddce01ec8d
4 changed files with 25 additions and 17 deletions
+1 -1
View File
@@ -42,4 +42,4 @@ RUN apt-get remove -y wget && \
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:5000", "--access-logfile", "-", "--error-logfile", "-", "--log-level", "info", "--capture-output", "aperisolve.wsgi:application"] CMD ["sh", "-c", "rm -rf /aperisolve/results/* && gunicorn -w 4 -b 0.0.0.0:5000 --access-logfile - --error-logfile - --log-level info --capture-output aperisolve.wsgi:application"]
+3 -1
View File
@@ -486,7 +486,9 @@ if (browseBtn) {
} catch (e) { } catch (e) {
showDanger("❌ Invalid server response.", true); showDanger("❌ Invalid server response.", true);
} }
} else { } else if (xhr.status == 413) {
showDanger("❌ File too large. Please upload a smaller file.", true);
}else {
showDanger(`❌ HTTP error ${xhr.status}`, true); showDanger(`❌ HTTP error ${xhr.status}`, true);
} }
progressBar.style.width = "100%"; progressBar.style.width = "100%";
+13 -12
View File
@@ -4,14 +4,13 @@ services:
build: . build: .
container_name: aperisolve-web container_name: aperisolve-web
restart: always restart: always
command: ["flask", "--app", "aperisolve.app", "run", "--host=0.0.0.0", "--port=5000"] command: ["/bin/sh", "-c", "rm -rf /aperisolve/results/* && flask --app aperisolve.app run --host=0.0.0.0 --port=5000"]
#command: ["/bin/sh", "-c", "flask --app aperisolve.app run --host=0.0.0.0 --port=5000"]
ports: ports:
- "5000:5000" - "5000:5000"
volumes: volumes:
- ./aperisolve:/aperisolve - ./aperisolve:/aperisolve
# Commented tmpfs for development to allow persistent results during code changes - apresults:/aperisolve/results # Shared named volume (renamed)
tmpfs:
- /aperisolve/results
depends_on: depends_on:
postgres: postgres:
condition: service_healthy condition: service_healthy
@@ -30,12 +29,11 @@ services:
build: . build: .
container_name: aperisolve-worker container_name: aperisolve-worker
restart: always restart: always
command: rq worker default --url redis://redis:6379/0 command: ["/bin/sh", "-c", "rm -rf /aperisolve/results/* && rq worker default --url redis://redis:6379/0"]
#command: ["/bin/sh", "-c", "rq worker default --url redis://redis:6379/0"]
volumes: volumes:
- ./aperisolve:/aperisolve - ./aperisolve:/aperisolve
# Commented tmpfs for development to allow persistent results during code changes - apresults:/aperisolve/results # Shared named volume (renamed)
tmpfs:
- /aperisolve/results
depends_on: depends_on:
- redis - redis
- postgres - postgres
@@ -56,9 +54,9 @@ services:
image: postgres:18 image: postgres:18
container_name: postgres container_name: postgres
restart: always restart: always
# Commented tmpfs for development to allow persistent results during code changes entrypoint: ["/bin/sh", "-c", "rm -rf /var/lib/postgresql/* && docker-entrypoint.sh postgres"]
tmpfs: volumes:
- /var/lib/postgresql - pgdata:/var/lib/postgresql
healthcheck: healthcheck:
test: ["CMD-SHELL", "pg_isready -U aperiuser -d aperisolve"] test: ["CMD-SHELL", "pg_isready -U aperiuser -d aperisolve"]
interval: 5s interval: 5s
@@ -67,7 +65,6 @@ services:
env_file: env_file:
- .env - .env
rqdashboard: rqdashboard:
image: eoranged/rq-dashboard image: eoranged/rq-dashboard
container_name: rq-dashboard container_name: rq-dashboard
@@ -78,3 +75,7 @@ services:
- redis - redis
env_file: env_file:
- .env - .env
volumes:
apresults:
pgdata:
+8 -3
View File
@@ -39,11 +39,12 @@ services:
- .env - .env
postgres: postgres:
image: postgres:14 image: postgres:18
container_name: postgres container_name: postgres
restart: always restart: always
tmpfs: entrypoint: ["/bin/sh", "-c", "rm -rf /var/lib/postgresql/* && docker-entrypoint.sh postgres"]
- /var/lib/postgresql volumes:
- pgdata:/var/lib/postgresql
healthcheck: healthcheck:
test: ["CMD-SHELL", "pg_isready -U aperiuser -d aperisolve"] test: ["CMD-SHELL", "pg_isready -U aperiuser -d aperisolve"]
interval: 5s interval: 5s
@@ -69,3 +70,7 @@ services:
- redis - redis
env_file: env_file:
- .env - .env
volumes:
apresults:
pgdata: