Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9341886
D5391.id19344.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
D5391.id19344.diff
View Options
diff --git a/docker/conf/web-keycloak.yml b/docker/conf/web-keycloak.yml
--- a/docker/conf/web-keycloak.yml
+++ b/docker/conf/web-keycloak.yml
@@ -32,8 +32,12 @@
serve_assets: yes
-development_db: /tmp/db.sqlite3
-production_db: /tmp/db.sqlite3
+production_db:
+ host: swh-web-db
+ port: 5432
+ name: swh-web
+ user: postgres
+ password: testpassword
throttling:
cache_uri: 127.0.0.1:11211
diff --git a/docker/conf/web-mirror.yml b/docker/conf/web-mirror.yml
--- a/docker/conf/web-mirror.yml
+++ b/docker/conf/web-mirror.yml
@@ -31,3 +31,10 @@
debug: yes
serve_assets: yes
+
+production_db:
+ host: swh-web-db
+ port: 5432
+ name: swh-web
+ user: postgres
+ password: testpassword
diff --git a/docker/conf/web-read-replica.yml b/docker/conf/web-read-replica.yml
--- a/docker/conf/web-read-replica.yml
+++ b/docker/conf/web-read-replica.yml
@@ -28,8 +28,12 @@
serve_assets: yes
-development_db: /tmp/db.sqlite3
-production_db: /tmp/db.sqlite3
+production_db:
+ host: swh-web-db
+ port: 5432
+ name: swh-web
+ user: postgres
+ password: testpassword
throttling:
cache_uri: 127.0.0.1:11211
diff --git a/docker/conf/web-search.yml b/docker/conf/web-search.yml
--- a/docker/conf/web-search.yml
+++ b/docker/conf/web-search.yml
@@ -33,8 +33,12 @@
serve_assets: yes
-development_db: /tmp/db.sqlite3
-production_db: /tmp/db.sqlite3
+production_db:
+ host: swh-web-db
+ port: 5432
+ name: swh-web
+ user: postgres
+ password: testpassword
throttling:
cache_uri: 127.0.0.1:11211
diff --git a/docker/conf/web.yml b/docker/conf/web.yml
--- a/docker/conf/web.yml
+++ b/docker/conf/web.yml
@@ -28,8 +28,12 @@
serve_assets: yes
-development_db: /tmp/db.sqlite3
-production_db: /tmp/db.sqlite3
+production_db:
+ host: swh-web-db
+ port: 5432
+ name: swh-web
+ user: postgres
+ password: testpassword
throttling:
cache_uri: 127.0.0.1:11211
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -211,6 +211,10 @@
- "./services/swh-indexer-storage/entrypoint.sh:/entrypoint.sh:ro"
# Web interface
+ swh-web-db:
+ image: postgres:12
+ env_file:
+ - ./env/01-web-db.env
swh-web:
build: ./
@@ -220,8 +224,11 @@
depends_on:
- swh-storage
- swh-idx-storage
+ - swh-web-db
env_file:
- ./env/common_python.env
+ - ./env/01-web-db.env
+ - ./env/02-web-db.env
environment:
VERBOSITY: 3
DJANGO_SETTINGS_MODULE: swh.web.settings.production
diff --git a/docker/env/01-web-db.env b/docker/env/01-web-db.env
new file mode 100644
--- /dev/null
+++ b/docker/env/01-web-db.env
@@ -0,0 +1,2 @@
+POSTGRES_DB=swh-web
+POSTGRES_PASSWORD=testpassword
diff --git a/docker/env/02-web-db.env b/docker/env/02-web-db.env
new file mode 100644
--- /dev/null
+++ b/docker/env/02-web-db.env
@@ -0,0 +1,3 @@
+PGHOST=swh-web-db
+PGUSER=postgres
+
diff --git a/docker/services/swh-web/entrypoint.sh b/docker/services/swh-web/entrypoint.sh
--- a/docker/services/swh-web/entrypoint.sh
+++ b/docker/services/swh-web/entrypoint.sh
@@ -15,6 +15,9 @@
User.objects.create_superuser(username, email, password);
"
+source /srv/softwareheritage/utils/pgsql.sh
+setup_pgsql
+
source /srv/softwareheritage/utils/pyutils.sh
setup_pip
@@ -26,6 +29,8 @@
echo "Starting memcached"
memcached&
+ wait_pgsql
+
echo "Migrating db using ${DJANGO_SETTINGS_MODULE}"
django-admin migrate --settings=${DJANGO_SETTINGS_MODULE}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 3, 12:21 PM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3222804
Attached To
D5391: swh-web: Migrate from sqlite to postgresql
Event Timeline
Log In to Comment