refresh the recipe
This commit is contained in:
parent
c2f2d52912
commit
436281f2e1
51
compose.yml
51
compose.yml
@ -1,9 +1,9 @@
|
||||
version: "3.8"
|
||||
services:
|
||||
app:
|
||||
image: rocketchat/rocket.chat:3.16.3
|
||||
image: rocketchat/rocket.chat:7.6.0
|
||||
depends_on:
|
||||
- db
|
||||
- mongodb
|
||||
volumes:
|
||||
- "rocketchat_uploads:/app/uploads"
|
||||
secrets:
|
||||
@ -11,11 +11,12 @@ services:
|
||||
environment:
|
||||
- PORT=3000
|
||||
- ROOT_URL=https://${DOMAIN}
|
||||
- MONGO_URL=mongodb://db:27017/rocketchat
|
||||
- MONGO_OPLOG_URL=mongodb://db:27017/local
|
||||
- MONGO_URL=mongodb://mongodb:27017/rocketchat
|
||||
- MONGO_OPLOG_URL=mongodb://mongodb:27017/local
|
||||
- ADMIN_USERNAME
|
||||
- ADMIN_PASS_FILE=/run/secrets/admin_password
|
||||
- ADMIN_EMAIL
|
||||
- DEPLOY_METHOD=docker
|
||||
#- HTTP_PROXY=http://proxy.domain.com
|
||||
#- HTTPS_PROXY=http://proxy.domain.com
|
||||
configs:
|
||||
@ -25,15 +26,7 @@ services:
|
||||
networks:
|
||||
- internal
|
||||
- proxy
|
||||
entrypoint: /docker-entrypoint.sh
|
||||
command: |
|
||||
bash -c
|
||||
"for i in `seq 1 30`; do
|
||||
node main.js &&
|
||||
s=$$? && break || s=$$?;
|
||||
echo \"Tried $$i times. Waiting 5 secs...\";
|
||||
sleep 5;
|
||||
done; (exit $$s)"
|
||||
#entrypoint: /docker-entrypoint.sh
|
||||
healthcheck:
|
||||
test: 'nodejs -e "http.get(''http://localhost:3000'', (res) => { console.log(''status: '', res.statusCode); if (res.statusCode == 200) { process.exit(0); } else { process.exit(1); } });"'
|
||||
interval: 30s
|
||||
@ -54,39 +47,17 @@ services:
|
||||
- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
|
||||
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
|
||||
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
|
||||
- coop-cloud.${STACK_NAME}.app.version=3.16.1-da4b65ff
|
||||
db:
|
||||
image: mongo:3.7
|
||||
- coop-cloud.${STACK_NAME}.version=0.1.0+7.6.0
|
||||
mongodb:
|
||||
image: docker.io/bitnami/mongodb:7.0
|
||||
volumes:
|
||||
- mongo:/data/db
|
||||
- mongo:/binami/mongodb
|
||||
#- ./data/dump:/dump
|
||||
command: mongod --smallfiles --oplogSize 128 --replSet rs0
|
||||
networks:
|
||||
- internal
|
||||
labels:
|
||||
- "traefik.enable=false"
|
||||
deploy:
|
||||
labels:
|
||||
- coop-cloud.${STACK_NAME}.db.version=3.7-736eec20
|
||||
# this container's job is just run the command to initialize the replica set.
|
||||
# it will run the command and remove himself (it will not stay running)
|
||||
mongo-init-replica:
|
||||
image: mongo:4.4
|
||||
command: |
|
||||
bash -c
|
||||
"for i in `seq 1 30`; do
|
||||
mongo db/rocketchat --eval \"
|
||||
rs.initiate({
|
||||
_id: 'rs0',
|
||||
members: [ { _id: 0, host: 'localhost:27017' } ]})\" &&
|
||||
s=$$? && break || s=$$?;
|
||||
echo \"Tried $$i times. Waiting 5 secs...\";
|
||||
sleep 5;
|
||||
done; (exit $$s)"
|
||||
depends_on:
|
||||
- db
|
||||
networks:
|
||||
- internal
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
|
@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
file_env() {
|
||||
# 3wc: Load $VAR_FILE into $VAR - useful for secrets. See
|
||||
# https://medium.com/@adrian.gheorghe.dev/using-docker-secrets-in-your-environment-variables-7a0609659aab
|
||||
local var="$1"
|
||||
local fileVar="${var}_FILE"
|
||||
local def="${2:-}"
|
||||
|
||||
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
|
||||
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
|
||||
exit 1
|
||||
fi
|
||||
local val="$def"
|
||||
if [ "${!var:-}" ]; then
|
||||
val="${!var}"
|
||||
elif [ "${!fileVar:-}" ]; then
|
||||
val="$(< "${!fileVar}")"
|
||||
fi
|
||||
export "$var"="$val"
|
||||
unset "$fileVar"
|
||||
}
|
||||
|
||||
load_vars() {
|
||||
file_env "ADMIN_PASS"
|
||||
file_env "OAUTH_KEY"
|
||||
}
|
||||
|
||||
main() {
|
||||
set -eu
|
||||
|
||||
load_vars
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
# 3wc: upstream ENTRYPOINT
|
||||
# we need to use `env` here because bash won't fuck with variable names with
|
||||
# hyphens, but both `env` and `node` seem fine..
|
||||
env Accounts_OAuth_Custom-Keycloak-secret=$OAUTH_KEY "$@"
|
Loading…
x
Reference in New Issue
Block a user