-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
70 lines (52 loc) · 2.32 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
# ./build/Dockerfile
FROM php:8.1-apache
# An Updated image with all dependancies we need
# End environment Defitinions
# Let's make sure we don't get prompted when installing packages
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# Add uvdesk user
RUN adduser uvdesk -q --disabled-password --gecos ""
# Install packages
RUN apt-get update && apt-get -y install wget git unzip zip curl nano;
# Install PHP extensions installer
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions
# Install PHP extensions
RUN install-php-extensions imap mailparse mysqli pdo_mysql
# Download the latest stable build
RUN wget "https://cdn.uvdesk.com/uvdesk/downloads/opensource/uvdesk-community-current-stable.zip" -P /var/www/
# Unzip contents
RUN unzip -q /var/www/uvdesk-community-current-stable.zip -d /var/www/
# Move to working directory
RUN mv /var/www/uvdesk-community-v1.1.1/ /var/www/uvdesk
# Copy configuration files for Apache
COPY ./.docker/config/apache2/env /etc/apache2/envvars
COPY ./.docker/config/apache2/httpd.conf /etc/apache2/apache2.conf
COPY ./.docker/config/apache2/vhost.conf /etc/apache2/sites-available/000-default.conf
# Run composer to build dependancies
RUN \
# Update apache configurations
a2enmod rewrite; \
# Download and verify composer installer signature
wget -O /usr/local/bin/composer.php "https://getcomposer.org/installer"; \
actualSig="$(wget -q -O - https://composer.github.io/installer.sig)"; \
currentSig="$(shasum -a 384 /usr/local/bin/composer.php | awk '{print $1}')"; \
if [ "$currentSig" != "$actualSig" ]; then \
echo "Warning: Failed to verify composer signature."; \
exit 1; \
fi; \
# Install composer
php /usr/local/bin/composer.php --install-dir=/usr/local/bin --filename=composer \ && chmod +x /usr/local/bin/composer;
#Add environment file
ADD env /var/www/uvdesk/.env
RUN chmod 775 /var/www/uvdesk/.env
# Start Apache Service
RUN service apache2 restart
# Clean up files
RUN rm -rf \
/var/www/html \
/usr/local/bin/composer.php \
/var/www/uvdesk-community-current-stable.zip;
RUN usermod -aG uvdesk root && usermod -aG uvdesk www-data;
RUN chown -R uvdesk:uvdesk /var/www;
WORKDIR /var/www