mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2024-11-21 23:41:01 +00:00
chore(docker): copy models first
This commit is contained in:
parent
e95915ff87
commit
4274543bc8
2 changed files with 8 additions and 5 deletions
|
@ -2,15 +2,18 @@ FROM python:3.8
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
# This expects the models submodule to be present
|
||||||
|
COPY models models
|
||||||
|
|
||||||
RUN pip install --upgrade pip
|
RUN pip install --upgrade pip
|
||||||
|
|
||||||
# Avoid rebuilding this step if no changes to requirements.txt
|
# Avoid rebuilding this step if no changes to requirements.txt
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
# Copy everything in the container
|
# Copy everything else
|
||||||
# This expects the models submodule to be present
|
COPY app app
|
||||||
COPY . .
|
COPY *.py LICENSE README.md ./
|
||||||
|
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
ENTRYPOINT [ "python", "main.py", "--host", "0.0.0.0" ]
|
ENTRYPOINT [ "python", "main.py", "--host", "0.0.0.0" ]
|
||||||
|
|
4
main.py
4
main.py
|
@ -19,13 +19,13 @@ parser.add_argument('--ssl', default=None, action="store_true",
|
||||||
parser.add_argument('--frontend-language-source', type=str, default="en", metavar="<language code>",
|
parser.add_argument('--frontend-language-source', type=str, default="en", metavar="<language code>",
|
||||||
help='Set frontend default language - source (%(default)s)')
|
help='Set frontend default language - source (%(default)s)')
|
||||||
parser.add_argument('--frontend-language-target', type=str, default="es", metavar="<language code>",
|
parser.add_argument('--frontend-language-target', type=str, default="es", metavar="<language code>",
|
||||||
help='Set frontend default language - target (%(default)s)')
|
help='Set frontend xxxdefault language - target (%(default)s)')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app = create_app(char_limit=args.char_limit,
|
app = create_app(char_limit=args.char_limit,
|
||||||
req_limit=args.req_limit,
|
req_limit=args.req_limit,
|
||||||
ga_id=args.ga_id,
|
ga_id=args.ga_id,
|
||||||
debug=args.debug,
|
debug=args.debug,
|
||||||
|
|
Loading…
Reference in a new issue