-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
84 lines (70 loc) · 2.4 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# This file is part of Bileto.
# Copyright 2022-2024 Probesys
# SPDX-License-Identifier: AGPL-3.0-or-later
# Build the assets
FROM node:20-alpine AS assets
WORKDIR /app
COPY package*.json /app
COPY assets/ /app/assets
RUN npm install && npm run build
# Configure the application
FROM php:8.2-apache
WORKDIR /var/www/html
ENV APP_ENV prod
ENV COMPOSER_HOME /tmp
ENV TZ Europe/Paris
CMD ["apache2-foreground"]
ENTRYPOINT ["sh", "/entrypoint.sh"]
ARG VERSION
ARG SOURCE_COMMIT
LABEL org.opencontainers.image.authors="Probesys <https://www.probesys.coop>" \
org.opencontainers.image.url="https://bileto.fr/" \
org.opencontainers.image.documentation="https://github.com/Probesys/bileto/tree/main/docs" \
org.opencontainers.image.source="https://github.com/Probesys/bileto" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.revision="${SOURCE_COMMIT}" \
org.opencontainers.image.vendor="Probesys" \
org.opencontainers.image.licenses="AGPL-3.0-or-later" \
org.opencontainers.image.title="Bileto" \
org.opencontainers.image.description="The ergonomic ticketing tool for managing your Help Desk."
# Install Composer
COPY --from=composer/composer /usr/bin/composer /usr/bin/composer
# Configure Apache
COPY docker/production/apache.conf /etc/apache2/sites-available/000-default.conf
# Install the dependencies
RUN apt-get update \
&& apt-get install -y \
libc-client-dev \
libicu-dev \
libkrb5-dev \
libldap-dev \
libpq-dev \
libxslt-dev \
libzip-dev \
unzip \
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-install -j$(nproc) \
imap \
intl \
ldap \
pdo \
pdo_mysql \
pdo_pgsql \
xsl \
zip \
&& a2dismod -qf alias \
&& a2enmod rewrite \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone \
&& printf '[PHP]\ndate.timezone = ${TZ}\n' > /usr/local/etc/php/conf.d/timezone.ini
# Copy the code in the image
COPY . .
RUN rm -rf public/assets
COPY --from=assets /app/public/assets/ public/assets/
COPY docker/production/entrypoint.sh /entrypoint.sh
# Set correct permissions
RUN chown -R www-data:www-data .
# Install the dependencies as www-data
USER www-data
RUN mkdir var uploads
RUN composer install --no-dev --optimize-autoloader --no-scripts