Change docker-compose.yml to use Postgres (#2)

This commit is contained in:
Sören Johanson 2024-08-21 17:10:57 +02:00 committed by GitHub
parent 8f410897a4
commit 3bd94d6118
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 34 additions and 17 deletions

View File

@ -23,8 +23,7 @@ services:
- "5011:8080" - "5011:8080"
restart: always restart: always
environment: environment:
STORAGE_URI: redis://:${REDIS_PASSWORD}@redis:6379 STORAGE_URI: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
STORAGE_TTL: 2592000000
excalidraw-room: excalidraw-room:
image: excalidraw/excalidraw-room image: excalidraw/excalidraw-room
@ -32,13 +31,22 @@ services:
ports: ports:
- "5012:80" - "5012:80"
redis: postgres:
image: redis image: postgres:15-alpine
command: redis-server --requirepass ${REDIS_PASSWORD} # Pass config parameters to the postgres server.
restart: always # Find more information below when you need to generate the ssl-relevant file your self
# command: -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_DB: ${POSTGRES_DB:-excalidraw-prod}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
POSTGRES_USER: ${POSTGRES_USER}
volumes: volumes:
- redis_data:/data - postgres_data:/var/lib/postgresql/data/pgdata
#ports:
# - "5432:5432"
volumes: volumes:
notused: notused:
redis_data: postgres_data:

View File

@ -19,26 +19,35 @@ services:
- ./:/opt/node_app/ - ./:/opt/node_app/
excalidraw-storage-backend: excalidraw-storage-backend:
stdin_open: true
build: build:
context: https://github.com/kitsteam/excalidraw-storage-backend.git#main context: https://github.com/kitsteam/excalidraw-storage-backend.git#main
target: production target: production
stdin_open: true
ports: ports:
- "8080:8080" - "8080:8080"
environment: environment:
STORAGE_URI: redis://:${REDIS_PASSWORD}@redis:6379 STORAGE_URI: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
STORAGE_TTL: 2592000000
excalidraw-room: excalidraw-room:
image: excalidraw/excalidraw-room image: excalidraw/excalidraw-room
ports: ports:
- "5001:80" - "5001:80"
redis: postgres:
image: redis image: postgres:15-alpine
command: redis-server --requirepass ${REDIS_PASSWORD} # Pass config parameters to the postgres server.
# Find more information below when you need to generate the ssl-relevant file your self
# command: -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_DB: ${POSTGRES_DB:-excalidraw-dev}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
POSTGRES_USER: ${POSTGRES_USER}
volumes: volumes:
- redis_data:/data - postgres_data:/var/lib/postgresql/data/pgdata
#ports:
# - "5432:5432"
volumes: volumes:
redis_data: postgres_data:
node_modules: node_modules: