# Base image for Rocket.Chat FROM rocketchat/base:8 ENV RC_VERSION 0.65.2 MAINTAINER buildmaster@rocket.chat # Install Rocket.Chat RUN set -x \ && curl -SLf "https://releases.rocket.chat/${RC_VERSION}/download/" -o rocket.chat.tgz \ && curl -SLf "https://releases.rocket.chat/${RC_VERSION}/asc" -o rocket.chat.tgz.asc \ && gpg --verify rocket.chat.tgz.asc \ && mkdir -p /app \ && tar -zxf rocket.chat.tgz -C /app \ && rm rocket.chat.tgz rocket.chat.tgz.asc \ && cd /app/bundle/programs/server \ && npm install \ && npm cache clear --force \ && chown -R rocketchat:rocketchat /app # Install NGINX for reverse proxy RUN apt-get update && \ apt-get install -y nginx && \ rm -rf /var/lib/apt/lists/* # Configure NGINX to proxy from port 7860 to Rocket.Chat’s internal port 3000 RUN echo "\ server {\n\ listen 7860;\n\ location / {\n\ proxy_pass http://localhost:3000;\n\ proxy_http_version 1.1;\n\ proxy_set_header Upgrade \$http_upgrade;\n\ proxy_set_header Connection 'upgrade';\n\ proxy_set_header Host \$host;\n\ proxy_cache_bypass \$http_upgrade;\n\ }\n\ }\n" > /etc/nginx/sites-available/default # Run NGINX in the background, then start Rocket.Chat USER rocketchat VOLUME /app/uploads WORKDIR /app/bundle # needs a mongo instance - defaults to container linking with alias 'mongo' ENV DEPLOY_METHOD=docker \ NODE_ENV=production \ MONGO_URL=mongodb://mongo:27017/rocketchat \ HOME=/tmp \ PORT=3000 \ ROOT_URL=http://localhost:3000 \ Accounts_AvatarStorePath=/app/uploads EXPOSE 7860 CMD service nginx start && node main.js