-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
54 lines (42 loc) · 1.48 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
49
50
51
52
53
54
# Based on PHP 8
FROM php:8-cli-buster
# Set maintainer
LABEL maintainer="Alexander Graf <[email protected]>"
# Change workdir
WORKDIR /src/
# Required to prevent warnings
ARG DEBIAN_FRONTEND=noninteractive
ARG DEBCONF_NONINTERACTIVE_SEEN=true
# Install dependencies and configure user
RUN apt-get update \
&& apt-get install -y --no-install-recommends --fix-missing \
libzip-dev \
unzip
# Install necessary extensions
RUN docker-php-ext-install pdo pdo_mysql mysqli zip
# Install composer
RUN php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer
# Copy files
COPY . .
# Install dependencies
RUN composer install --no-interaction
# Build arguments
ARG VCS_REF=main \
BUILD_DATE="" \
VERSION="${VCS_REF}"
# http://label-schema.org/rc1/
LABEL org.label-schema.schema-version "1.0"
LABEL org.label-schema.name "nextcloud-cleanup"
LABEL org.label-schema.vendor "otherguy"
LABEL org.label-schema.version "${VERSION}"
LABEL org.label-schema.build-date "${BUILD_DATE}"
LABEL org.label-schema.description "Cleans up files on Nextcloud S3 storage that are left over from canceled uploads."
LABEL org.label-schema.vcs-url "https://github.com/otherguy/nextcloud-cleanup"
LABEL org.label-schema.vcs-ref "${VCS_REF}"
# Expose environment variables to app
ENV VCS_REF="${VCS_REF}" \
BUILD_DATE="${BUILD_DATE}" \
VERSION="${VERSION}"
# Entrypoint and Command
ENTRYPOINT ["php"]
CMD ["clean.php"]