From 3abd63e924f0b64115ae77bba5622dfbc2f1789b Mon Sep 17 00:00:00 2001 From: mungai-njoroge Date: Wed, 27 Mar 2024 08:34:44 +0300 Subject: [PATCH] reduce dockerfile layers --- Dockerfile | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 367136ae..1a8fcfb2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,6 @@ FROM node:latest AS CLIENT -ARG client_tag - -RUN git clone --branch $client_tag --depth 1 https://github.com/swing-opensource/swingmusic-client.git client +RUN git clone --depth 1 https://github.com/swing-opensource/swingmusic-client.git client WORKDIR /client @@ -11,13 +9,12 @@ WORKDIR /client # RUN git checkout $client_tag RUN yarn install - RUN yarn build -FROM python:3.10-slim - +FROM python:3.11-slim WORKDIR /app/swingmusic +# Copy the files in the current dir into the container COPY . . COPY --from=CLIENT /client/dist/ client @@ -28,15 +25,13 @@ VOLUME /music VOLUME /config -RUN python -m venv /venv - -# RUN poetry config virtualenvs.create false -RUN . /venv/bin/activate - -# RUN poetry install RUN pip install -r requirements.txt -RUN apt-get update && apt-get install -y ffmpeg libavcodec-extra gcc-aarch64-linux-gnu +RUN apt-get update && apt-get install -y ffmpeg libavcodec-extra gcc-aarch64-linux-gnu && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +ARG app_version +ENV SWINGMUSIC_APP_VERSION=$app_version -# ENTRYPOINT ["poetry", "run", "python", "manage.py", "--host", "0.0.0.0", "--config", "/config"] ENTRYPOINT ["python", "manage.py", "--host", "0.0.0.0", "--config", "/config"]