diff --git a/web/Dockerfile b/web/Dockerfile index 31b22cf..16cc0e6 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -1,6 +1,6 @@ FROM python:3-slim -RUN apt update && apt upgrade && apt install -y git +RUN apt update && apt upgrade && apt install -y git automake libtool g++-multilib-i686-linux-gnu zlib1g-dev build-essential gcc g++ libxml2 libxml2-dev libxslt1.1 libxslt1-dev RUN git clone https://git.sr.ht/~metalune/simplytranslate_engines engines && \ git clone https://git.sr.ht/~metalune/simplytranslate_web web @@ -9,8 +9,7 @@ WORKDIR /engines RUN python3 setup.py install && \ pip install -r requirements.txt WORKDIR /web -RUN pip install -r requirements.txt && \ - pip install uvicorn +RUN pip install -r requirements.txt EXPOSE 5000 CMD ["python3", "main.py"] diff --git a/web/config.conf b/web/config.conf new file mode 100644 index 0000000..dc16f48 --- /dev/null +++ b/web/config.conf @@ -0,0 +1,27 @@ +# This is an example configuration file. It can be either +# /etc/simplytranslate/web.conf or /etc/simplytranslate/shared.conf (this one +# is also used by other frontends, like the Gemini frontend). In case of +# duplicate keys between files, the key in `gemini.conf` takes precedence. + +[libre] +# LibreTranslate is disabled by default. If it is enabled, `Instance` is required. +Enabled = False +Instance = https://libretranslate.com +# Not all instances need an API key; if the one you use don't, remove this +# line. +ApiKey = [REDACTED] + +[google] +# Google translate is enabled by default. +Enabled = True + +[deepl] +Enabled = False + +[iciba] +# ICIBA Translate (a.k.a. PowerWord) is disabled by default. +Enabled = True + +[network] +port = 5000 +host = 0.0.0.0 diff --git a/web/docker-compose.yml b/web/docker-compose.yml index c3b0e74..f00a3a2 100644 --- a/web/docker-compose.yml +++ b/web/docker-compose.yml @@ -3,11 +3,8 @@ version: "3.6" services: simplytranslate: build: . - container_name: "simplytranslate" - networks: - - egress + container_name: simplytranslate ports: - - "5000:5000" -networks: - egress: - external: true + - "127.0.0.1:5000:5000" + volumes: + - "./config.conf:/etc/simplytranslate/web.conf" diff --git a/web/uvicorn/Dockerfile b/web/uvicorn/Dockerfile index d502178..fb1959f 100644 --- a/web/uvicorn/Dockerfile +++ b/web/uvicorn/Dockerfile @@ -1,6 +1,6 @@ FROM python:3-slim -RUN apt update && apt upgrade && apt install -y git +RUN apt update && apt upgrade && apt install -y git automake libtool g++-multilib zlib1g-dev build-essential gcc g++ libxml2 libxml2-dev libxslt1.1 libxslt1-dev RUN git clone https://git.sr.ht/~metalune/simplytranslate_engines engines && \ git clone https://git.sr.ht/~metalune/simplytranslate_web web