speckle-server/docker-compose-speckle.yml

88 строки
2.6 KiB
YAML
Исходник Обычный вид История

version: '2'
services:
speckle-frontend:
build:
context: .
dockerfile: packages/frontend/Dockerfile
image: speckle/speckle-frontend:local
restart: always
ports:
chore(frontend): use bitnami/openresty as base image for frontend Dockerfile (#1335) * chore(frontend): use bitnami/openresty as base image for frontend Dockerfile openresty/openresty was not being patched as frequently as we would like, resulting in numerous vulnerabilities without resolution. bitnami/openresty is being patched more frequently. Some additional changes were necessary when porting our frontend between these distributions: - html files are in /app - nginx.conf is in /opt/bitnami/openresty/nginx/conf/nginx.conf - envsubst is not available by default in bitnami/openresty and needs to be copied in - Nginx.conf - we wrap the server block in http block and overwrite root nginx.conf - using the existing bitnami/openresty nginx.conf as a server block alone causes issues with bitnami/openresty, as bitnami/openresty provides a root nginx.conf which conflicts with directives in Speckle's server block - we copy the directives from openresty/openresty (which are known to work with Speckle's server block), and apply them alongside Speckle's server block. This creates a new root nginx.conf which we can overwrite the default on the image. - nginx should use a port available to non sudo/root user, we have selected 8080 instead of previous 80 - need to explicitly output nginx logs to stderr / stdout Created a readonly root file system on Kubernetes. This requires the following changes: - emptyDir volumes are mounted in kubernetes to allow bitnami/openresty to write to specific locations - explicitly include and copy mime.types file to nginx configuration directory Due to the change to non-privileged port number (8080), the following subsequent changes were required: - Update 1-click deployment script to match frontend at port 8080 - Updates docker-compose-speckle.yaml file Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2023-01-25 22:06:48 +03:00
- '0.0.0.0:80:8080'
environment:
FILE_SIZE_LIMIT_MB: 100
speckle-server:
build:
context: .
dockerfile: packages/server/Dockerfile
image: speckle/speckle-server:local
restart: always
healthcheck:
test:
- CMD
- node
- -e
- "require('node:http').request({headers: {'Content-Type': 'application/json'}, port:3000, hostname:'127.0.0.1', path:'/graphql?query={serverInfo{version}}', method: 'GET' }, (res) => { body = ''; res.on('data', (chunk) => {body += chunk;}); res.on('end', () => {process.exit(res.statusCode != 200 || body.toLowerCase().includes('error'));}); }).end();"
interval: 10s
timeout: 10s
retries: 3
start_period: 5s
environment:
# TODO: Change this to the URL of the speckle server, as accessed from the network
CANONICAL_URL: 'http://localhost'
# TODO: Change this to a unique secret for this server
SESSION_SECRET: 'TODO:Replace'
STRATEGY_LOCAL: 'true'
LOG_LEVEL: 'info'
POSTGRES_URL: 'postgres'
POSTGRES_USER: 'speckle'
POSTGRES_PASSWORD: 'speckle'
POSTGRES_DB: 'speckle'
REDIS_URL: 'redis://redis'
S3_ENDPOINT: 'http://minio:9000'
S3_ACCESS_KEY: 'minioadmin'
S3_SECRET_KEY: 'minioadmin'
S3_BUCKET: 'speckle-server'
S3_CREATE_BUCKET: 'true'
S3_REGION: '' # optional, defaults to 'us-east-1'
FILE_SIZE_LIMIT_MB: 100
preview-service:
build:
context: .
dockerfile: packages/preview-service/Dockerfile
image: speckle/speckle-preview-service:local
restart: always
mem_limit: '3000m'
memswap_limit: '3000m'
environment:
LOG_LEVEL: 'info'
PG_CONNECTION_STRING: 'postgres://speckle:speckle@postgres/speckle'
webhook-service:
build:
context: .
dockerfile: packages/webhook-service/Dockerfile
image: speckle/speckle-webhook-service:local
restart: always
environment:
LOG_LEVEL: 'info'
PG_CONNECTION_STRING: 'postgres://speckle:speckle@postgres/speckle'
fileimport-service:
build:
context: .
dockerfile: packages/fileimport-service/Dockerfile
image: speckle/speckle-fileimport-service:local
restart: always
environment:
LOG_LEVEL: 'info'
PG_CONNECTION_STRING: 'postgres://speckle:speckle@postgres/speckle'
SPECKLE_SERVER_URL: 'http://speckle-server:3000'
FILE_IMPORT_TIME_LIMIT_MIN: 10