-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathDockerfile
More file actions
74 lines (62 loc) · 1.91 KB
/
Dockerfile
File metadata and controls
74 lines (62 loc) · 1.91 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
69
70
71
72
73
74
ARG VERSION_PHP=8.3
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 GIT_TREE=${APP_GH_REF##*/}
ARG UPSTREAM_URL="https://github.com/librebooking/librebooking"
WORKDIR /upstream
RUN <<EORUN
set -eux
git clone ${UPSTREAM_URL} /upstream
git checkout ${GIT_TREE}
if [ "${APP_GH_ADD_SHA}" = "true" ]; then
git describe --tags --long > config/custom-version.txt
fi
rm -rf .git
EORUN
# Build supercronic
FROM golang:trixie AS supercronic
ADD https://github.com/aptible/supercronic.git#v0.2.44 /go/src/
WORKDIR /go/src
RUN <<EORUN
set -eux
go mod vendor
go install
EORUN
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 \
/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