diff --git a/Dockerfile b/Dockerfile index f9f4d54..ba9349c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.7 +FROM python:3.7-alpine ARG hostuid=1000 ARG hostgid=1000 @@ -6,6 +6,8 @@ ARG hostgid=1000 ENV TECHREC_CONFIG=/src/techrec/docker/config.py ENV DEBIAN_FRONTEND=noninteractive +RUN apk update && apk add ffmpeg shadow + WORKDIR /src COPY . /src/techrec @@ -13,10 +15,7 @@ RUN groupadd -g ${hostgid} techrec \ && useradd -g techrec -u ${hostuid} -m techrec \ && mkdir -p /src/techrec \ && mkdir -p /src/db \ - && chown -R techrec:techrec /src \ - && apt-get -qq update \ - && apt-get install -qq -y ffmpeg \ - && rm -rf /var/lib/apt/lists/* + && chown -R techrec:techrec /src USER techrec @@ -28,5 +27,4 @@ RUN python -m venv ./venv \ VOLUME ["/src/db"] EXPOSE 8000 -ENTRYPOINT ["/src/venv/bin/techrec"] -CMD ["-vv", "serve"] +CMD ["/src/techrec/docker/run-techrec.sh"] diff --git a/docker/run-techrec.sh b/docker/run-techrec.sh new file mode 100755 index 0000000..0968098 --- /dev/null +++ b/docker/run-techrec.sh @@ -0,0 +1,5 @@ +#!/bin/sh +source /src/venv/bin/activate +pip install /src/techrec +/src/venv/bin/techrec forge 20230330-210204 20230330-232100 +/bin/sh