-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (37 loc) · 1.54 KB
/
Dockerfile
File metadata and controls
47 lines (37 loc) · 1.54 KB
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
FROM public.ecr.aws/docker/library/php:8.2-cli AS builder
RUN DEBIAN_FRONTEND=noninteractive \
apt-get update \
&& apt-get install -y --no-install-recommends \
libzip-dev \
git \
&& docker-php-ext-install zip \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/cloudtranscode
# Copy only dependency files first for better layer caching
COPY composer.json composer.lock Makefile ./
RUN make
# Copy the rest of the source
COPY . .
RUN rm -f composer.phar
# Fetch presets submodule in case it wasn't initialized in the build context
RUN if [ ! -f presets/480p-generic.json ]; then \
rm -rf presets && \
git clone --branch develop https://github.com/sportarchive/CloudTranscode-FFMpeg-presets.git presets; \
fi
# ---- runtime ----
FROM public.ecr.aws/docker/library/php:8.2-cli
RUN echo "date.timezone = UTC" >> /usr/local/etc/php/conf.d/timezone.ini \
&& DEBIAN_FRONTEND=noninteractive \
apt-get update \
&& apt-get install -y --no-install-recommends \
libzip5 \
imagemagick \
ffmpeg \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -r -u 1001 -g root worker
COPY --from=builder /usr/local/lib/php/extensions/no-debug-non-zts-20220829/zip.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/
COPY --from=builder /usr/local/etc/php/conf.d/docker-php-ext-zip.ini /usr/local/etc/php/conf.d/
COPY --from=builder --chown=worker:root /usr/src/cloudtranscode /usr/src/cloudtranscode
WORKDIR /usr/src/cloudtranscode
USER worker
ENTRYPOINT ["/usr/src/cloudtranscode/bootstrap.sh"]