Page MenuHomeSoftware Heritage

D815.id2595.diff
No OneTemporary

D815.id2595.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-storage/entrypoint.sh b/dockerfiles/swh-storage/entrypoint.sh
--- a/dockerfiles/swh-storage/entrypoint.sh
+++ b/dockerfiles/swh-storage/entrypoint.sh
@@ -19,7 +19,7 @@
;;
"init")
echo Setup the database
- swh-db-init storage --db-name ${POSTGRES_DB} --no-create True
+ swh-db-init storage --db-name ${POSTGRES_DB} --no-create
;;
*)
echo Starting the swh-storage API server
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 && \
+ 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,18 @@
+#!/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 --verbosity 3 --insecure 0.0.0.0:5004
+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,19 @@
+storage:
+ cls: remote
+ args:
+ url: http://swh-storage:5002/
+ timeout: 1
+
+objstorage:
+ cls: remote
+ args:
+ url: http://swh-objstorage:5003/
+
+indexer_storage:
+ cls: memory
+ args: {}
+
+allowed_hosts:
+ - "*"
+
+debug: yes

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 17, 2:53 PM (1 w, 30 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3230780

Event Timeline