Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +11 -10
Dockerfile
CHANGED
|
@@ -18,13 +18,15 @@ RUN set -x \
|
|
| 18 |
&& npm cache clear --force \
|
| 19 |
&& chown -R rocketchat:rocketchat /app
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
RUN
|
| 23 |
-
sed -i '/security.debian.org/d' /etc/apt/sources.list && \
|
| 24 |
-
apt-get update && \
|
| 25 |
-
apt-get install -y socat && \
|
| 26 |
-
rm -rf /var/lib/apt/lists/*
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
USER rocketchat
|
| 30 |
|
|
@@ -41,9 +43,8 @@ ENV DEPLOY_METHOD=docker \
|
|
| 41 |
ROOT_URL=http://localhost:3000 \
|
| 42 |
Accounts_AvatarStorePath=/app/uploads
|
| 43 |
|
| 44 |
-
# Expose port 7860
|
| 45 |
EXPOSE 7860
|
| 46 |
|
| 47 |
-
#
|
| 48 |
-
CMD
|
| 49 |
-
node main.js
|
|
|
|
| 18 |
&& npm cache clear --force \
|
| 19 |
&& chown -R rocketchat:rocketchat /app
|
| 20 |
|
| 21 |
+
# Install http-proxy to enable reverse proxy
|
| 22 |
+
RUN npm install -g http-proxy
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
# Create a proxy script to forward traffic from 7860 to 3000
|
| 25 |
+
RUN echo "\
|
| 26 |
+
const httpProxy = require('http-proxy');\n\
|
| 27 |
+
const proxy = httpProxy.createProxyServer({ target: 'http://localhost:3000' });\n\
|
| 28 |
+
proxy.listen(7860, () => console.log('Proxy server listening on port 7860'));\
|
| 29 |
+
" > /app/proxy.js
|
| 30 |
|
| 31 |
USER rocketchat
|
| 32 |
|
|
|
|
| 43 |
ROOT_URL=http://localhost:3000 \
|
| 44 |
Accounts_AvatarStorePath=/app/uploads
|
| 45 |
|
| 46 |
+
# Expose the external port 7860
|
| 47 |
EXPOSE 7860
|
| 48 |
|
| 49 |
+
# Start the proxy server and Rocket.Chat
|
| 50 |
+
CMD node /app/proxy.js & node main.js
|
|
|