forked from ReadAlongs/Studio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (40 loc) · 1.59 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM debian:bullseye-slim
ENV APPHOME /opt/readalong-studio
ENV PORT 5000
# Lean, optimized installation of system dependencies
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes \
python3 \
python3-pip \
git \
ffmpeg \
vim-nox \
less \
&& apt-get clean \
&& apt-get autoremove \
&& rm -fr /var/lib/apt/lists/*
# Install 3rd party dependencies in their own layer, for faster rebuilds when we
# change ReadAlong-Studio source code
ADD requirements.* $APPHOME/
RUN python3 -m pip install --upgrade pip \
&& python3 -m pip install -r $APPHOME/requirements.txt \
&& python3 -m pip install gevent
# We don't want Docker to cache the installation of g2p or Studio, so place them
# after COPY . $APPHOME, which almost invariable invalidates the cache.
COPY . $APPHOME
WORKDIR $APPHOME
# Get and install the latest g2p
RUN git clone https://github.com/roedoejet/g2p.git \
&& cd g2p \
&& python3 -m pip install -e .
# Install ReadAlong-Studio itself
RUN python3 -m pip install -e .
# Run the default gui (on localhost:5000, make sure you use -p 5000:5000 when
# you docker run the image)
CMD python3 ./run.py
# For a production server, comment out the default gui CMD above, and run the
# gui using gunicorn instead:
# CMD gunicorn -k gevent -w 1 readalongs.app:app --bind 0.0.0.0:$PORT
# For the web API, use this CMD instead, the same on our Heroku deployment, except
# with binding to port 5000
# CMD gunicorn -w 4 -k uvicorn.workers.UvicornWorker readalongs.web_api:web_api_app --bind 0.0.0.0:$PORT