Merge pull request #2 from coldfix/master

Add Dockerfile
pull/4/head
Elis Popescu 4 years ago committed by GitHub
commit 3920a560c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,26 @@
FROM alpine:3.11
ENV URL=http://localhost:5000
ARG build_deps="go make dep"
ARG runtime_deps="dumb-init"
ARG user_id=1000
COPY . /go/src/github.com/elisescu/tty-server
RUN apk update && \
apk add -u $build_deps $runtime_deps && \
adduser -D -H -h / -u $user_id tty-server && \
cd /go/src/github.com/elisescu/tty-server && \
GOPATH=/go dep ensure && \
GOPATH=/go make all && \
cp tty-server /usr/bin/ && \
rm -r /go && \
apk del $build_deps
EXPOSE 5000
EXPOSE 6543
USER tty-server
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/bin/sh", "-c", "/usr/bin/tty-server -web_address :5000 --sender_address :6543 -url $URL"]

@ -4,3 +4,29 @@
Server side for [tty-share](https://github.com/elisescu/tty-share).
## Docker
The server can be built into a docker image as follows:
docker build -t tty-server .
To run the container, type:
docker run \
-p 6543:6543 -p 5000:5000 \
-e URL=http://localhost:5000 \
--cap-drop=all --rm \
tty-server
where you can replace `URL` by whatever will be the publicly visible URL of the server.
After this, clients can be connected as follows:
tty-share -useTLS=false -server localhost:6543
In the above command, 6543 is the default port where `tty-server` listens for
incoming shares (i.e. `tty-share` clients), and 5000 is the port of the web
interface through which remote users can connect. You can override the
defaults by specifying a different port mapping on the command line, e.g.
`-p 7654:6543 -p 80:5000` to listen on `7654` and serve on `80`.

Loading…
Cancel
Save