0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

chore: update docker compose

This commit is contained in:
Gao Sun 2022-07-05 19:56:20 +08:00
parent 2d16454370
commit 1e96221acf
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
4 changed files with 16 additions and 7 deletions

View file

@ -5,7 +5,7 @@ tasks:
command: | command: |
ENDPOINT=$(gp url 3001) docker compose -p logto up ENDPOINT=$(gp url 3001) docker compose -p logto up
env: env:
TAG: edge TAG: prerelease
ports: ports:
- name: Logto - name: Logto

View file

@ -3,16 +3,24 @@ version: "3.9"
services: services:
app: app:
depends_on: depends_on:
- postgres postgres:
condition: service_healthy
image: ghcr.io/logto-io/logto:${TAG-latest} image: ghcr.io/logto-io/logto:${TAG-latest}
ports: ports:
- 3001:3001 - 3001:3001
environment: environment:
ALL_YES: 1 - ALL_YES=1
NO_INQUIRY: 0 - NO_INQUIRY=0
DB_URL_DEFAULT: postgres://postgres:p0stgr3s@postgres:5432 - TRUST_PROXY_HEADER=1
- DB_URL_DEFAULT=postgres://postgres:p0stgr3s@postgres:5432
- ENDPOINT
postgres: postgres:
image: postgres:14-alpine image: postgres:14-alpine
environment: environment:
POSTGRES_USER: postgres POSTGRES_USER: postgres
POSTGRES_PASSWORD: p0stgr3s POSTGRES_PASSWORD: p0stgr3s
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5

View file

@ -5,6 +5,7 @@ import { appendPath } from '@/utils/url';
import createPoolByEnv from './create-pool-by-env'; import createPoolByEnv from './create-pool-by-env';
import loadOidcValues from './oidc'; import loadOidcValues from './oidc';
import { isTrue } from './parameters';
export enum MountedApps { export enum MountedApps {
Api = 'api', Api = 'api',
@ -32,7 +33,7 @@ const loadEnvValues = async () => {
localhostUrl, localhostUrl,
endpoint, endpoint,
developmentUserId: getEnv('DEVELOPMENT_USER_ID'), developmentUserId: getEnv('DEVELOPMENT_USER_ID'),
trustProxyHeader: getEnv('TRUST_PROXY_HEADER') === 'true', trustProxyHeader: isTrue(getEnv('TRUST_PROXY_HEADER')),
oidc: await loadOidcValues(appendPath(endpoint, '/oidc').toString()), oidc: await loadOidcValues(appendPath(endpoint, '/oidc').toString()),
adminConsoleUrl: appendPath(endpoint, '/console'), adminConsoleUrl: appendPath(endpoint, '/console'),
}); });

View file

@ -1,6 +1,6 @@
import { getEnv } from '@silverhand/essentials'; import { getEnv } from '@silverhand/essentials';
const isTrue = (value: string) => ['1', 'true', 'y', 'yes', 'yep', 'yeah'].includes(value); export const isTrue = (value: string) => ['1', 'true', 'y', 'yes', 'yep', 'yeah'].includes(value);
const parameters = new Set(process.argv.slice(2)); const parameters = new Set(process.argv.slice(2));
export const noInquiry = parameters.has('--no-inquiry') || isTrue(getEnv('NO_INQUIRY')); export const noInquiry = parameters.has('--no-inquiry') || isTrue(getEnv('NO_INQUIRY'));