AndrewBelt/hack.chat

About running hack.chat in docker based on alpine

fanvinga opened this issue · 11 comments

Halo:)
I have written a Dockerfile to build up a docker of Hack.Chat that includes both of server and client based on alpine.
But I met a problem that when I access the address such as example.com/?test the only thing I can see is a black screen without the input box of NickName.Just like that https://vinga.cf/?test
Would you please help me to solve this problem ?
Here is my docker hub and github repo address.
https://hub.docker.com/r/fanvinga/docker-hackchat
https://github.com/fanvinga/docker-hackchat
:-)

Alse I check the status of "node server.js" running.After I manually change the port either in config.json or in client/client.js , it can run well.If I use the default port.server.js could not start

FROM alpine:latest
MAINTAINER FAN VINGAfanalcest@gmail.com

ENV ADMIN_NAME admin
ENV PASSWORD password
ENV SALT randomsaltyoulike

RUN apk update && apk add git make nodejs nodejs-npm supervisor
RUN git clone https://github.com/AndrewBelt/hack.chat.git &&
cd hack.chat &&
npm install &&
cp config-sample.json config.json &&
sed -i "s/AzureDiamond/${ADMIN_NAME}/g" ./config.json &&
sed -i "s/hunter2/${PASSWORD}/g" ./config.json &&
sed -i "s/insert-randomly-generated-string-here/${SALT}/g" ./config.json &&
cd client &&
npm install -g less jade http-server &&
make &&
apk del git make nodejs-npm &&
rm -rf /var/cache/apk/*

WORKDIR /hack.chat/
COPY supervisord.conf /etc/supervisor/supervisord.conf
CMD supervisord -c /etc/supervisor/supervisord.conf
EXPOSE 8080 6060

Here is my Dockerfile :)

Hi, it's really simple if you open the DevTools on the page.

image

As you see, while your page is served via HTTPS (securely) your websocket connection is attempted on an insecure server.

Code-wise it simply means you need to use wss:// instead of ws:// in the WebSocket url. Assuming that the port 4389 on your server is secure.

Aha as I am a student of Chinese high school , the only device have is an iPhone.So I do not ware of using DevTools:(
For some reasons , i

I will temporarily use http instead of HTTPS.the good news is I finally see the NickName input box.However I met another problem that the "node server.js" accidentally quit.here is the log
0a6662cf-51f2-4074-a0e8-414e94c1bddc

See #136 for the solution. it's a known issue.

Emm..bother you again:(
A new error after git checkout 5ca90f9.
After finish input NickName.nothing happen.
3f329db5-7e66-476b-84d2-020df88b954a

I think you have to delete the node modules folder and run npm install again. The issue might come from still having the wrong version of the ws module

Thank you so much for your patient answer --It works now :)
The final question I wanna ask is why not fix the issue #136 ? What I clone is the latest source code.

You'd have to ask @AndrewBelt or rather @marzavec since the problem comes from his own PR