Last active
October 27, 2024 21:25
-
-
Save debdutdeb/f1a02a3ef2dd42f3e0eb523395625abe to your computer and use it in GitHub Desktop.
`docker compose up -d` then head over to http://ip:3000
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
volumes: | |
mongodb_data: { driver: local } | |
services: | |
rocketchat: | |
image: registry.rocket.chat/rocketchat/rocket.chat:${RELEASE:-latest} | |
restart: always | |
environment: | |
MONGO_URL: "${MONGO_URL:-\ | |
mongodb://${MONGODB_ADVERTISED_HOSTNAME:-mongodb}:${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}/\ | |
${MONGODB_DATABASE:-rocketchat}?replicaSet=${MONGODB_REPLICA_SET_NAME:-rs0}}" | |
MONGO_OPLOG_URL: "${MONGO_OPLOG_URL:\ | |
-mongodb://${MONGODB_ADVERTISED_HOSTNAME:-mongodb}:${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}/\ | |
local?replicaSet=${MONGODB_REPLICA_SET_NAME:-rs0}}" | |
ROOT_URL: ${ROOT_URL:-http://localhost:${HOST_PORT:-3000}} | |
PORT: ${PORT:-3000} | |
DEPLOY_METHOD: docker | |
DEPLOY_PLATFORM: ${DEPLOY_PLATFORM} | |
command: | |
- sh | |
- -c | |
- | | |
export INSTANCE_IP=$$(hostname -I) | |
node main.js | |
depends_on: | |
mongodb: | |
condition: service_started | |
rocketchat2: | |
image: registry.rocket.chat/rocketchat/rocket.chat:${RELEASE:-latest} | |
restart: always | |
environment: | |
MONGO_URL: "${MONGO_URL:-\ | |
mongodb://${MONGODB_ADVERTISED_HOSTNAME:-mongodb}:${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}/\ | |
${MONGODB_DATABASE:-rocketchat}?replicaSet=${MONGODB_REPLICA_SET_NAME:-rs0}}" | |
MONGO_OPLOG_URL: "${MONGO_OPLOG_URL:\ | |
-mongodb://${MONGODB_ADVERTISED_HOSTNAME:-mongodb}:${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017}/\ | |
local?replicaSet=${MONGODB_REPLICA_SET_NAME:-rs0}}" | |
ROOT_URL: ${ROOT_URL:-http://localhost:${HOST_PORT:-3000}} | |
PORT: ${PORT:-3000} | |
DEPLOY_METHOD: docker | |
DEPLOY_PLATFORM: ${DEPLOY_PLATFORM} | |
command: | |
- sh | |
- -c | |
- | | |
export INSTANCE_IP=$$(hostname -I) | |
node main.js | |
depends_on: | |
mongodb: | |
condition: service_started | |
mongodb: | |
image: docker.io/bitnami/mongodb:${MONGODB_VERSION:-5.0} | |
restart: always | |
volumes: | |
- mongodb_data:/bitnami/mongodb | |
environment: | |
MONGODB_REPLICA_SET_MODE: primary | |
MONGODB_REPLICA_SET_NAME: ${MONGODB_REPLICA_SET_NAME:-rs0} | |
MONGODB_PORT_NUMBER: ${MONGODB_PORT_NUMBER:-27017} | |
MONGODB_INITIAL_PRIMARY_HOST: ${MONGODB_INITIAL_PRIMARY_HOST:-mongodb} | |
MONGODB_INITIAL_PRIMARY_PORT_NUMBER: ${MONGODB_INITIAL_PRIMARY_PORT_NUMBER:-27017} | |
MONGODB_ADVERTISED_HOSTNAME: ${MONGODB_ADVERTISED_HOSTNAME:-mongodb} | |
MONGODB_ENABLE_JOURNAL: ${MONGODB_ENABLE_JOURNAL:-true} | |
ALLOW_EMPTY_PASSWORD: ${ALLOW_EMPTY_PASSWORD:-yes} | |
proxy: | |
image: nginx | |
volumes: | |
- ./nginx.conf:/etc/nginx/conf.d/nginx.conf:ro | |
depends_on: | |
rocketchat: | |
condition: service_started | |
rocketchat2: | |
condition: service_started | |
ports: | |
- 3000:80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream rocket_goes_boooo { | |
server rocketchat:3000; | |
server rocketchat2:3000; | |
} | |
server { | |
listen 80 default_server; | |
server_name _; | |
location / { | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "Upgrade"; | |
proxy_set_header Host $host; | |
proxy_pass http://rocket_goes_boooo; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
EDIT: Just tried now (2024-10-27) and the config in my comment did not work. I have absolutely no idea what happened.
Here, a cookie for your trouble: 🍪
Old Comment
Had to modify the nginx config for it to work. Maybe outdated compared to the version when you first wrote it? Anyway, here goes:
http {
upstream rocketchat {
server rocketchat:3000;
server rocketchat2:3000;
}
}