Skip to content

Commit

Permalink
Update local development to use Postgres by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ericof committed Sep 3, 2023
1 parent bcb115b commit 7bcd925
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 37 deletions.
5 changes: 4 additions & 1 deletion backend/instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ default_context:
load_zcml:
package_includes: ['ploneorg']

db_storage: direct
db_storage: relstorage
db_relstorage_postgresql_driver: psycopg2
db_relstorage_postgresql_dsn: dbname='ploneorg' user='ploneorg' host='localhost' password='ploneorg'
db_blobs_mode: cache
2 changes: 2 additions & 0 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
-c constraints.txt
-e src/ploneorg[test]

relstorage==3.5.0
psycopg2==2.9.5
zope.testrunner
44 changes: 8 additions & 36 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,16 @@
version: "3"
services:

webserver:
image: nginx
volumes:
- ./default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- backend
- frontend
ports:
- "80:80"
version: "3.8"


frontend:
build:
context: ../../frontend
environment:
RAZZLE_INTERNAL_API_PATH: http://backend:8080/Plone
ports:
- "3000:3000"
depends_on:
- backend


backend:
build:
context: ../../backend
ports:
- "8080:8080"
environment:
RELSTORAGE_DSN: "dbname='${DB_NAME:-plone}' user='${DB_USER:-plone}' host='${DB_HOST:-db}' password='${DB_PASSWORD:-plone}'"
depends_on:
- db
services:

db:
image: postgres:14.2
environment:
POSTGRES_USER: plone
POSTGRES_PASSWORD: plone
POSTGRES_DB: plone
POSTGRES_USER: ploneorg
POSTGRES_PASSWORD: ploneorg
POSTGRES_DB: ploneorg
command: postgres -c shared_buffers=4GB -c effective_cache_size=12GB -c maintenance_work_mem=1GB -c wal_buffers=16MB -c random_page_cost=1.1 -c effective_io_concurrency=200 -c work_mem=20971kB -c min_wal_size=2GB -c max_wal_size=8GB -c wal_keep_size=1GB -c max_locks_per_transaction=512
ports:
- 5432:5432
volumes:
- data:/var/lib/postgresql/data

Expand Down

0 comments on commit 7bcd925

Please sign in to comment.