Merge pull request #827 from AmruthPillai/compose-envs

Remove YAML anchors and prefer Docker Compose Environment Arrays
This commit is contained in:
Amruth Pillai 2022-04-09 22:01:41 +02:00 committed by GitHub
commit 386e8ab902
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 49 additions and 52 deletions

View File

@ -1,10 +1,10 @@
# Shared
# Server + Client
TZ=UTC
PUBLIC_URL=http://localhost
PUBLIC_SERVER_URL=http://localhost/api
PUBLIC_URL=http://localhost:3000
PUBLIC_SERVER_URL=http://localhost:3000/api
PUBLIC_GOOGLE_CLIENT_ID=
# Database
# Server + Database
POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
@ -16,7 +16,6 @@ POSTGRES_PORT=5432
POSTGRES_SSL_CERT=
JWT_SECRET=
JWT_EXPIRY_TIME=604800
PUBLIC_GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_API_KEY=
SENDGRID_API_KEY=
@ -30,5 +29,5 @@ STORAGE_URL_PREFIX=
STORAGE_ACCESS_KEY=
STORAGE_SECRET_KEY=
# Flags
# Flags (Client)
PUBLIC_FLAG_DISABLE_SIGNUPS=false

View File

@ -3,6 +3,7 @@
"ignorePatterns": [".next", "__ENV.js"],
"rules": {
"@next/next/no-img-element": "off",
"@next/next/no-sync-scripts": "off"
"@next/next/no-sync-scripts": "off",
"@next/next/no-html-link-for-pages": [2, "client/pages"]
}
}

View File

@ -1,49 +1,13 @@
version: '3'
x-env-shared: &env-shared
environment:
- TZ=UTC
- PUBLIC_URL=http://localhost
- PUBLIC_SERVER_URL=http://localhost/api
- PUBLIC_GOOGLE_CLIENT_ID=
x-env-database: &env-database
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
x-env-server: &env-server
environment:
- SECRET_KEY=
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_SSL_CERT=
- JWT_SECRET=
- JWT_EXPIRY_TIME=604800
- PUBLIC_GOOGLE_CLIENT_ID=
- GOOGLE_CLIENT_SECRET=
- GOOGLE_API_KEY=
- SENDGRID_API_KEY=
- SENDGRID_FORGOT_PASSWORD_TEMPLATE_ID=
- SENDGRID_FROM_NAME=
- SENDGRID_FROM_EMAIL=
- STORAGE_BUCKET=
- STORAGE_REGION=
- STORAGE_ENDPOINT=
- STORAGE_URL_PREFIX=
- STORAGE_ACCESS_KEY=
- STORAGE_SECRET_KEY=
x-env-flags: &env-flags
environment:
- PUBLIC_FLAG_DISABLE_SIGNUPS=false
services:
postgres:
image: postgres:14.2-alpine
container_name: postgres
<<: *env-database
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- 5432:5432
volumes:
@ -70,10 +34,36 @@ services:
server:
image: amruthpillai/reactive-resume:server-latest
# build:
# context: .
# dockerfile: ./server/Dockerfile
container_name: server
<<: *env-shared
<<: *env-server
<<: *env-database
environment:
- TZ=UTC
- PUBLIC_URL=http://localhost:3000
- PUBLIC_SERVER_URL=http://localhost:3000/api
- PUBLIC_GOOGLE_CLIENT_ID=
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- SECRET_KEY=
- POSTGRES_HOST=postgres
- POSTGRES_PORT=5432
- POSTGRES_SSL_CERT=
- JWT_SECRET=
- JWT_EXPIRY_TIME=604800
- GOOGLE_CLIENT_SECRET=
- GOOGLE_API_KEY=
- SENDGRID_API_KEY=
- SENDGRID_FORGOT_PASSWORD_TEMPLATE_ID=
- SENDGRID_FROM_NAME=
- SENDGRID_FROM_EMAIL=
- STORAGE_BUCKET=
- STORAGE_REGION=
- STORAGE_ENDPOINT=
- STORAGE_URL_PREFIX=
- STORAGE_ACCESS_KEY=
- STORAGE_SECRET_KEY=
depends_on:
- traefik
- postgres
@ -88,9 +78,16 @@ services:
client:
image: amruthpillai/reactive-resume:client-latest
# build:
# context: .
# dockerfile: ./client/Dockerfile
container_name: client
<<: *env-shared
<<: *env-flags
environment:
- TZ=UTC
- PUBLIC_URL=http://localhost:3000
- PUBLIC_SERVER_URL=http://localhost:3000/api
- PUBLIC_GOOGLE_CLIENT_ID=
- PUBLIC_FLAG_DISABLE_SIGNUPS=false
depends_on:
- traefik
- server