mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
refactor(docker): directus use postgress, redis and fix cors (#26)
* directus use postgress, redis and fix cors In order to use gis features you can install some plugins to sqlite or use postgres which supports those features natively. Use a redis cache as this was part of the advanced setup example. Furthermore fix cors and allow http://localhost:8080 by default. * lint fixes
This commit is contained in:
parent
02833c79af
commit
1d00438440
@ -1,5 +1,5 @@
|
|||||||
services:
|
services:
|
||||||
server:
|
frontend:
|
||||||
image: cupcakearmy/static
|
image: cupcakearmy/static
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
@ -7,14 +7,64 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./dist:/srv:ro
|
- ./dist:/srv:ro
|
||||||
|
|
||||||
|
database:
|
||||||
|
image: postgis/postgis:13-master
|
||||||
|
# Required when running on platform other than amd64, like Apple M1/M2:
|
||||||
|
# platform: linux/amd64
|
||||||
|
volumes:
|
||||||
|
- ./data/database:/var/lib/postgresql/data
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: 'directus'
|
||||||
|
POSTGRES_PASSWORD: 'directus'
|
||||||
|
POSTGRES_DB: 'directus'
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD', 'pg_isready', '--host=localhost', '--username=directus']
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
start_interval: 5s
|
||||||
|
start_period: 30s
|
||||||
|
|
||||||
|
cache:
|
||||||
|
image: redis:6
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD-SHELL', "[ $$(redis-cli ping) = 'PONG' ]"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
start_interval: 5s
|
||||||
|
start_period: 30s
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
container_name: backend
|
container_name: backend
|
||||||
build:
|
build:
|
||||||
context: ./backend
|
context: ./backend
|
||||||
|
depends_on:
|
||||||
|
database:
|
||||||
|
condition: service_healthy
|
||||||
|
cache:
|
||||||
|
condition: service_healthy
|
||||||
ports:
|
ports:
|
||||||
- 8055:8055
|
- 8055:8055
|
||||||
environment:
|
environment:
|
||||||
- SECRET=SECRET
|
PUBLIC_URL: 'http://localhost'
|
||||||
- PUBLIC_URL=http://localhost
|
|
||||||
- ADMIN_EMAIL=admin@it4c.dev
|
SECRET: 'SECRET'
|
||||||
- ADMIN_PASSWORD=admin123
|
|
||||||
|
CORS_ENABLED: 'true'
|
||||||
|
CORS_ORIGIN: 'http://localhost:8080'
|
||||||
|
|
||||||
|
DB_CLIENT: 'pg'
|
||||||
|
DB_HOST: 'database'
|
||||||
|
DB_PORT: '5432'
|
||||||
|
DB_DATABASE: 'directus'
|
||||||
|
DB_USER: 'directus'
|
||||||
|
DB_PASSWORD: 'directus'
|
||||||
|
|
||||||
|
CACHE_ENABLED: 'true'
|
||||||
|
CACHE_AUTO_PURGE: 'true'
|
||||||
|
CACHE_STORE: 'redis'
|
||||||
|
REDIS: 'redis://cache:6379'
|
||||||
|
|
||||||
|
ADMIN_EMAIL: 'admin@it4c.dev'
|
||||||
|
ADMIN_PASSWORD: 'admin123'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user