muke1908 / chat-e2ee

End-to-end encrypted disposable chat sessions, exchange sensitive information with peer safely and securely.
https://chat-e2ee-2.azurewebsites.net/
Apache License 2.0
322 stars 196 forks source link

fixed Docker container #353

Closed nexus-uw closed 2 months ago

nexus-uw commented 2 months ago

I was unable to run the docker container as it exists today in the repo. In order to fix it I:

  1. upgraded the base image to lts-alpine (points to node 20 today) in order to slim down the container and keeping the node version up to date
  2. moved some commands around in the Dockerfile so that it builds (was failing with sh: webpack command not found`)
  3. run the Docker container as node user (instead of root)
  4. left some random future upgrade options to improve the container
  5. fixed the docker_start script

additionally, I included the default GitHub action script to build + publish the container to the GitHub repo. this could be removed from the PR if not desired

testing

built + ran the Docker container

muke1908 commented 2 months ago

@nexus-uw Thanks a lot for the PR. Can you please expand a bit on the purpose of github workflow, where and how it's going to be used?

nexus-uw commented 2 months ago

purpose of github workflow,

it will build and publish the Docker container on each commit to the master branch

where

it will publish to the github Docker registry under muke1908/chat-e2ee

how it's going to be used?

people who choose to selfhost chat-e2ee can pull in the latest changes to this project without having to pull the latest from GitHub. this is pretty handy if one is running Docker containers on a host that is running watchtower

muke1908 commented 2 months ago

@nexus-uw can you please add this info to readme ?

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

nexus-uw commented 2 months ago

3 further updates were added to this PR (since I'm lazing working against master in my fork)

  1. updated docker readme to include details about the pre-built image (as requested)
  2. when running in prod, have the client set the api endpoint to the current domain. before this, the api was configured to be the default url in the sdk, chat-e2ee-2.azurewebsites.net. since running the server in production mode is serving both the api + client under the same domain, I believe that this is the desired behavior
  3. linting fix for the above