Add dockerfile and docker instructions

parent 9e0eaa06
# Based on https://github.com/erlang/docker-erlang-example
FROM erlang:alpine
RUN apk add --no-cache git
RUN mkdir -p /build/mtproto_proxy
WORKDIR /build/mtproto_proxy
COPY src src
COPY rebar3 rebar3
COPY rebar.config rebar.config
COPY rebar.lock rebar.lock
COPY config config
RUN rebar3 as prod release
FROM alpine
RUN apk add --no-cache openssl && \
apk add --no-cache ncurses-libs
RUN mkdir -p /opt
RUN mkdir -p /var/log/mtproto-proxy
COPY --from=0 /build/mtproto_proxy/_build/prod/rel/mtp_proxy /opt/mtp_proxy
CMD ["/opt/mtp_proxy/bin/mtp_proxy", "foreground"]
...@@ -17,8 +17,21 @@ Features ...@@ -17,8 +17,21 @@ Features
* Small codebase compared to oficial one * Small codebase compared to oficial one
* A lots of metrics could be exported (optional) * A lots of metrics could be exported (optional)
How to start - quick How to start - docker
-------------------- ---------------------
1. Get the code `git clone https://github.com/seriyps/mtproto_proxy.git && cd mtproto_proxy/`
2. Copy config templates `cp config/{vm.args.example,prod-vm.args}; cp config/{sys.config.example,prod-sys.config}`
3. Edit configs. See [Settings](#settings).
4. Build `docker build -t mtproto-proxy-erl .`
5. Start `docker run -d --network=host mtproto-proxy-erl`
Installation via docker can work well for small setups (10-20k connections), but
for more heavily-loaded setups it's recommended to install proxy directly into
your server's OS (see below).
How to start without docker - quick
-----------------------------------
``` ```
sudo apt install erlang-nox erlang-dev build-essential sudo apt install erlang-nox erlang-dev build-essential
...@@ -33,8 +46,8 @@ sudo systemctl enable mtproto-proxy ...@@ -33,8 +46,8 @@ sudo systemctl enable mtproto-proxy
sudo systemctl start mtproto-proxy sudo systemctl start mtproto-proxy
``` ```
How to start - detailed How to start without docker - detailed
-------------------- --------------------------------------
### Install deps (ubuntu 18.04) ### Install deps (ubuntu 18.04)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment