Files
Anthias/docker/Dockerfile.test.tmpl
Viktor Petersson 722b08d868 Overhauls caching
2023-02-16 11:41:55 +00:00

53 lines
1.7 KiB
Cheetah

# @TODO: Uncomment this build stage when test_add_asset_streaming is fixed.
# FROM debian:buster as builder
# RUN apt-get update && \
# apt-get -y install --no-install-recommends \
# build-essential \
# git \
# ca-certificates && \
# apt-get clean
# RUN cd /opt && \
# git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg && \
# cd ffmpeg && \
# git checkout 2ca65fc7b74444edd51d5803a2c1e05a801a6023 && \
# ./configure --disable-x86asm && make -j$(nproc) --quiet
RUN --mount=type=cache,target=/var/cache/apt \
apt-get -y install wget unzip
# @TODO: Uncomment the lines below when test_add_asset_streaming is fixed.
# WORKDIR /opt/ffmpeg
# COPY --from=builder /opt/ffmpeg/ffserver ./
ADD requirements/requirements.txt /tmp/requirements.txt
ADD requirements/requirements.dev.txt /tmp/requirements.dev.txt
ADD requirements/requirements.viewer.txt /tmp/requirements.viewer.txt
RUN wget $CHROMEDRIVER_DL_URL -O /tmp/chromedriver.zip && \
unzip -o /tmp/chromedriver.zip -d /usr/bin
RUN --mount=type=cache,target=/var/cache/apt \
wget $CHROME_DL_URL -O /tmp/chrome.deb && \
apt-get -y update && \
apt-get install -y /tmp/chrome.deb
RUN --mount=type=cache,target=/root/.cache/pip \
pip install \
-r /tmp/requirements.txt \
-r /tmp/requirements.dev.txt \
-r /tmp/requirements.viewer.txt
RUN mkdir -p /usr/src/app
COPY . /usr/src/app
WORKDIR /usr/src/app
RUN mkdir -p /data/.screenly /data/screenly_assets /tmp/USB/cleanup_folder
RUN cp ansible/roles/screenly/files/screenly.db \
ansible/roles/screenly/files/screenly.conf /data/.screenly
ENV GIT_HASH=$GIT_HASH
ENV GIT_SHORT_HASH=$GIT_SHORT_HASH
ENV GIT_BRANCH=$GIT_BRANCH