Page MenuHomeSoftware Heritage

D815.id2591.diff
No OneTemporary

D815.id2591.diff

diff --git a/docker-compose.yml b/docker-compose.yml
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -24,3 +24,12 @@
image: swh/objstorage
ports:
- 5003:5003
+
+ swh-web:
+ build: ./dockerfiles/swh-web
+ image: swh/web
+ ports:
+ - 5004:5004
+ depends_on:
+ - swh-objstorage
+ - swh-storage
diff --git a/dockerfiles/swh-web/Dockerfile b/dockerfiles/swh-web/Dockerfile
new file mode 100644
--- /dev/null
+++ b/dockerfiles/swh-web/Dockerfile
@@ -0,0 +1,23 @@
+FROM python:3
+
+RUN export DEBIAN_FRONTEND=noninteractive && \
+ apt-get update && apt-get upgrade -y && \
+ apt-get install -y libsystemd-dev gunicorn3 && \
+ apt-get clean && \
+ rm -rf /var/lib/apt/lists/*
+
+RUN pip install swh-web
+
+RUN python3 -m swh.web.manage migrate
+
+RUN pip install psycopg2-binary # to make pip silent
+
+COPY web.yml /etc/softwareheritage/web/
+
+RUN cat /etc/softwareheritage/web/web.yml
+
+COPY entrypoint.sh /
+
+ENTRYPOINT ["/entrypoint.sh"]
+
+EXPOSE 5004
diff --git a/dockerfiles/swh-web/entrypoint.sh b/dockerfiles/swh-web/entrypoint.sh
new file mode 100755
--- /dev/null
+++ b/dockerfiles/swh-web/entrypoint.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+set -e
+
+if [[ -d /src ]] ; then
+ for srcrepo in /src/swh-* ; do
+ echo installing $srcrepo
+ pip install -e .
+ popd
+ done
+fi
+
+if [ "$1" = 'shell' ] ; then
+ exec bash -i
+else
+ echo "starting the swh-web server"
+ exec python3 -m swh.web.manage runserver --nostatic 0.0.0.0:5004
+ #exec gunicorn3 -b 0.0.0.0:5004 swh.web.wsgi
+fi
diff --git a/dockerfiles/swh-web/web.yml b/dockerfiles/swh-web/web.yml
new file mode 100644
--- /dev/null
+++ b/dockerfiles/swh-web/web.yml
@@ -0,0 +1,14 @@
+storage:
+ cls: remote
+ args:
+ url: http://localhost:5002/
+ timeout: 1
+
+objstorage:
+ cls: remote
+ args:
+ url: http://localhost:5003/
+
+indexer_storage:
+ cls: memory
+ args: {}

File Metadata

Mime Type
text/plain
Expires
Dec 17 2024, 9:55 AM (11 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3221030

Event Timeline