Skip to content

Commit

Permalink
Merge pull request #90 from yunkon-kim/241025-15
Browse files Browse the repository at this point in the history
Add docker-compose.yaml and templates for credentials
  • Loading branch information
yunkon-kim authored Oct 25, 2024
2 parents e8059b4 + 39f66e7 commit 0d10a5a
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@ logs/

!secrets
secrets/**
!secrets/template-*
!secrets/.keep
!secrets/README.md
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ ENV TERRARIUM_API_ALLOW_ORIGINS=* \
## Logger configuration
# Set log file path (default logfile path: ./log/terrarium.log)
# Set log level, such as trace, debug info, warn, error, fatal, and panic
ENV LOGFILE_PATH=/app/log/terrarium.log \
LOGFILE_MAXSIZE=1000 \
LOGFILE_MAXBACKUPS=3 \
LOGFILE_MAXAGE=30 \
LOGFILE_COMPRESS=false \
LOGLEVEL=info \
LOGWRITER=both
ENV TERRARIUM_LOGFILE_PATH=/app/log/terrarium.log \
TERRARIUM_LOGFILE_MAXSIZE=1000 \
TERRARIUM_LOGFILE_MAXBACKUPS=3 \
TERRARIUM_LOGFILE_MAXAGE=30 \
TERRARIUM_LOGFILE_COMPRESS=false \
TERRARIUM_LOGLEVEL=info \
TERRARIUM_LOGWRITER=both

# Set execution environment, such as development or production
ENV NODE_ENV=production
ENV TERRARIUM_NODE_ENV=production

## Set period for auto control goroutine invocation
ENV TERRARIUM_AUTOCONTROL_DURATION_MS=10000
Expand Down
35 changes: 35 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
services:
mc-terrarium:
image: cloudbaristaorg/mc-terrarium:edge
container_name: mc-terrarium
ports:
- target: 8888
published: 8888
protocol: tcp
env_file:
- ./secrets/credentials # AWS credentials
- ./secrets/credential-azure.env # Azure credentials
volumes:
- ./secrets:/app/secrets:ro # GCP credentials
environment:
# - TERRARIUM_ROOT=/app
# - TERRARIUM_SELF_ENDPOINT=localhost:8888
# - TERRARIUM_API_ALLOW_ORIGINS=*
# - TERRARIUM_API_AUTH_ENABLED=true
# - TERRARIUM_API_USERNAME=default
# - TERRARIUM_API_PASSWORD=default
# - TERRARIUM_LOGFILE_PATH=/app/log/terrarium.log
# - TERRARIUM_LOGFILE_MAXSIZE=1000
# - TERRARIUM_LOGFILE_MAXBACKUPS=3
# - TERRARIUM_LOGFILE_MAXAGE=30
# - TERRARIUM_LOGFILE_COMPRESS=false
- TERRARIUM_LOGLEVEL=debug
# - TERRARIUM_LOGWRITER=both
# - TERRARIUM_NODE_ENV=production
# - TERRARIUM_AUTOCONTROL_DURATION_MS=10000
healthcheck: # for MC-Terrarirum
test: [ "CMD", "curl", "-f", "http://localhost:8888/terrarium/readyz" ]
interval: 1m
timeout: 5s
retries: 3
start_period: 10s
4 changes: 4 additions & 0 deletions secrets/template-azure.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ARM_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
ARM_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ARM_TENANT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
ARM_SUBSCRIPTION_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
12 changes: 12 additions & 0 deletions secrets/template-credential-gcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "service_account",
"project_id": "xxxxxxx",
"private_key_id": "x0x0x00xxxxx0x0xx0xx0xx0xxx0xx",
"private_key": "-----BEGIN PRIVATE KEY-----\ndlkjadlfa90erew90rh2kj354h3k214u249203432094\n......\n..........\n..............==\n-----END PRIVATE KEY-----\n",
"client_email": "[email protected]",
"client_id": "xxxxxxx",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/xxxxxxxxx%40xxxxxxxxxxxx.iam.gserviceaccount.com"
}
3 changes: 3 additions & 0 deletions secrets/template-credentials
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[default]
AWS_ACCESS_KEY_ID=XXXXXXXXXX
AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXX

0 comments on commit 0d10a5a

Please sign in to comment.