Spaces:
Runtime error
Runtime error
sanjay7178
commited on
Create Dockerfile
Browse files- Dockerfile +58 -0
Dockerfile
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Base image for Rocket.Chat
|
2 |
+
FROM rocketchat/base:8
|
3 |
+
|
4 |
+
ENV RC_VERSION 0.65.2
|
5 |
+
|
6 |
+
MAINTAINER buildmaster@rocket.chat
|
7 |
+
|
8 |
+
# Install Rocket.Chat
|
9 |
+
RUN set -x \
|
10 |
+
&& curl -SLf "https://releases.rocket.chat/${RC_VERSION}/download/" -o rocket.chat.tgz \
|
11 |
+
&& curl -SLf "https://releases.rocket.chat/${RC_VERSION}/asc" -o rocket.chat.tgz.asc \
|
12 |
+
&& gpg --verify rocket.chat.tgz.asc \
|
13 |
+
&& mkdir -p /app \
|
14 |
+
&& tar -zxf rocket.chat.tgz -C /app \
|
15 |
+
&& rm rocket.chat.tgz rocket.chat.tgz.asc \
|
16 |
+
&& cd /app/bundle/programs/server \
|
17 |
+
&& npm install \
|
18 |
+
&& npm cache clear --force \
|
19 |
+
&& chown -R rocketchat:rocketchat /app
|
20 |
+
|
21 |
+
# Install NGINX for reverse proxy
|
22 |
+
RUN apt-get update && \
|
23 |
+
apt-get install -y nginx && \
|
24 |
+
rm -rf /var/lib/apt/lists/*
|
25 |
+
|
26 |
+
# Configure NGINX to proxy from port 7860 to Rocket.Chat’s internal port 3000
|
27 |
+
RUN echo "\
|
28 |
+
server {\n\
|
29 |
+
listen 7860;\n\
|
30 |
+
location / {\n\
|
31 |
+
proxy_pass http://localhost:3000;\n\
|
32 |
+
proxy_http_version 1.1;\n\
|
33 |
+
proxy_set_header Upgrade \$http_upgrade;\n\
|
34 |
+
proxy_set_header Connection 'upgrade';\n\
|
35 |
+
proxy_set_header Host \$host;\n\
|
36 |
+
proxy_cache_bypass \$http_upgrade;\n\
|
37 |
+
}\n\
|
38 |
+
}\n" > /etc/nginx/sites-available/default
|
39 |
+
|
40 |
+
# Run NGINX in the background, then start Rocket.Chat
|
41 |
+
USER rocketchat
|
42 |
+
|
43 |
+
VOLUME /app/uploads
|
44 |
+
|
45 |
+
WORKDIR /app/bundle
|
46 |
+
|
47 |
+
# needs a mongo instance - defaults to container linking with alias 'mongo'
|
48 |
+
ENV DEPLOY_METHOD=docker \
|
49 |
+
NODE_ENV=production \
|
50 |
+
MONGO_URL=mongodb://mongo:27017/rocketchat \
|
51 |
+
HOME=/tmp \
|
52 |
+
PORT=3000 \
|
53 |
+
ROOT_URL=http://localhost:3000 \
|
54 |
+
Accounts_AvatarStorePath=/app/uploads
|
55 |
+
|
56 |
+
EXPOSE 7860
|
57 |
+
|
58 |
+
CMD service nginx start && node main.js
|