change docker entrypoint to clear content
This commit is contained in:
+1
-1
@@ -42,4 +42,4 @@ RUN apt-get remove -y wget && \
|
||||
apt-get clean && \
|
||||
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"]
|
||||
|
||||
@@ -486,6 +486,8 @@ if (browseBtn) {
|
||||
} catch (e) {
|
||||
showDanger("❌ Invalid server response.", true);
|
||||
}
|
||||
} else if (xhr.status == 413) {
|
||||
showDanger("❌ File too large. Please upload a smaller file.", true);
|
||||
}else {
|
||||
showDanger(`❌ HTTP error ${xhr.status}`, true);
|
||||
}
|
||||
|
||||
+13
-12
@@ -4,14 +4,13 @@ services:
|
||||
build: .
|
||||
container_name: aperisolve-web
|
||||
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:
|
||||
- "5000:5000"
|
||||
volumes:
|
||||
- ./aperisolve:/aperisolve
|
||||
# Commented tmpfs for development to allow persistent results during code changes
|
||||
tmpfs:
|
||||
- /aperisolve/results
|
||||
- apresults:/aperisolve/results # Shared named volume (renamed)
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
@@ -30,12 +29,11 @@ services:
|
||||
build: .
|
||||
container_name: aperisolve-worker
|
||||
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:
|
||||
- ./aperisolve:/aperisolve
|
||||
# Commented tmpfs for development to allow persistent results during code changes
|
||||
tmpfs:
|
||||
- /aperisolve/results
|
||||
- apresults:/aperisolve/results # Shared named volume (renamed)
|
||||
depends_on:
|
||||
- redis
|
||||
- postgres
|
||||
@@ -56,9 +54,9 @@ services:
|
||||
image: postgres:18
|
||||
container_name: postgres
|
||||
restart: always
|
||||
# Commented tmpfs for development to allow persistent results during code changes
|
||||
tmpfs:
|
||||
- /var/lib/postgresql
|
||||
entrypoint: ["/bin/sh", "-c", "rm -rf /var/lib/postgresql/* && docker-entrypoint.sh postgres"]
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U aperiuser -d aperisolve"]
|
||||
interval: 5s
|
||||
@@ -67,7 +65,6 @@ services:
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
|
||||
rqdashboard:
|
||||
image: eoranged/rq-dashboard
|
||||
container_name: rq-dashboard
|
||||
@@ -78,3 +75,7 @@ services:
|
||||
- redis
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
volumes:
|
||||
apresults:
|
||||
pgdata:
|
||||
|
||||
+8
-3
@@ -39,11 +39,12 @@ services:
|
||||
- .env
|
||||
|
||||
postgres:
|
||||
image: postgres:14
|
||||
image: postgres:18
|
||||
container_name: postgres
|
||||
restart: always
|
||||
tmpfs:
|
||||
- /var/lib/postgresql
|
||||
entrypoint: ["/bin/sh", "-c", "rm -rf /var/lib/postgresql/* && docker-entrypoint.sh postgres"]
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U aperiuser -d aperisolve"]
|
||||
interval: 5s
|
||||
@@ -69,3 +70,7 @@ services:
|
||||
- redis
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
volumes:
|
||||
apresults:
|
||||
pgdata:
|
||||
|
||||
Reference in New Issue
Block a user