-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathDockerfile
More file actions
68 lines (54 loc) · 1.82 KB
/
Copy pathDockerfile
File metadata and controls
68 lines (54 loc) · 1.82 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
ARG VERSION_PHP=8.5.7
ARG VERSION_COMPOSER=lts
ARG VERSION_GIT=2.52.0
FROM composer:${VERSION_COMPOSER} AS comp
# Get upstream
FROM alpine/git:${VERSION_GIT} AS upstream
ARG APP_GH_ADD_SHA=false
ARG APP_GH_REF=refs/heads/develop
ARG UPSTREAM_URL="https://github.com/librebooking/librebooking"
WORKDIR /upstream
RUN <<EOF
set -eu
git clone "${UPSTREAM_URL}" --branch "$(basename ${APP_GH_REF})" .
if [ "${APP_GH_ADD_SHA}" = "true" ]; then
git describe --tags --long >config/custom-version.txt
fi
EOF
# Build supercronic
FROM golang:trixie AS supercronic
RUN go install github.com/aptible/supercronic@v0.2.44
FROM php:${VERSION_PHP}-apache
# Labels
LABEL org.opencontainers.image.title="LibreBooking"
LABEL org.opencontainers.image.description="LibreBooking as a container"
LABEL org.opencontainers.image.url="https://github.com/librebooking/docker"
LABEL org.opencontainers.image.source="https://github.com/librebooking/docker"
LABEL org.opencontainers.image.licenses="GPL-3.0"
LABEL org.opencontainers.image.authors="colisee@hotmail.com"
# Copy bin scripts
COPY --chmod=0755 bin /usr/local/bin/
# Copy cron jobs
COPY --chown=www-data:www-data --chmod=0755 \
lb-jobs-cron /config/
# Copy composer
COPY --from=comp /usr/bin/composer /usr/bin/composer
# Copy supercronic
COPY --from=supercronic \
/go/bin/supercronic /usr/local/bin/supercronic
# Copy Librebooking
COPY --from=upstream \
--chown=www-data:root --chmod=0775 \
--exclude=.git* \
/upstream/ /var/www/html/
# Customize the system environment
ENV DEBIAN_FRONTEND=noninteractive
RUN bash /usr/local/bin/build_sys.sh
# Customize the image environment
USER www-data:root
VOLUME /config
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["apache2-foreground"]
EXPOSE 8080
# Customize the application environment
RUN bash /usr/local/bin/build_app.sh