forked from lirantal/daloradius
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
89 lines (73 loc) · 2.25 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
85
86
87
88
89
# Official daloRADIUS Dockerfile
# GitHub: https://github.com/lirantal/daloradius
#
# Build image:
# 1. git pull [email protected]:lirantal/daloradius.git
# 2. docker build . -t lirantal/daloradius
#
# Run the container:
# 1. docker run -p 80:80 -d lirantal/daloradius
FROM ubuntu:20.04
MAINTAINER Liran Tal <[email protected]>
LABEL Description="daloRADIUS Official Docker based on Ubuntu 20.04 LTS and PHP7." \
License="GPLv2" \
Usage="docker build . -t lirantal/daloradius && docker run -d -p 80:80 lirantal/daloradius" \
Version="1.0"
ENV DEBIAN_FRONTEND noninteractive
# default timezone
ENV TZ Europe/Vienna
# PHP install
RUN apt-get update \
&& apt-get install --yes --no-install-recommends \
ca-certificates \
apt-utils \
freeradius-utils \
tzdata \
apache2 \
libapache2-mod-php \
cron \
net-tools \
php \
php-common \
php-gd \
php-curl \
php-mail \
php-dev \
php-mail-mime \
php-db \
php-mysql \
mariadb-client \
libmysqlclient-dev \
unzip \
wget \
&& rm -rf /var/lib/apt/lists/*
# PHP Pear DB library install
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& update-ca-certificates -f \
&& mkdir -p /tmp/pear/cache \
&& wget http://pear.php.net/go-pear.phar \
&& php go-pear.phar \
&& rm go-pear.phar \
&& pear channel-update pear.php.net \
&& pear install -a -f DB \
&& pear install -a -f Mail \
&& pear install -a -f Mail_Mime
# Add current project directory which should be a clone of daloradius from:
# [email protected]:lirantal/daloradius.git
# Create directories
# /data should be mounted as volume to avoid recreation of database entries
RUN mkdir /data /internal_data
ADD . /var/www/html
RUN chown -R www-data:www-data /var/www/html
# Enable the .htaccess in /var/www/html
RUN /bin/sed -i 's/AllowOverride\ None/AllowOverride\ All/g' /etc/apache2/apache2.conf
# Make init.sh script executable
RUN chmod +x /var/www/html/init.sh
# Remove the original sample index.html file
RUN rm -rf /var/www/html/index.html
# Create daloRADIUS Log file
RUN touch /var/log/daloradius.log && chown -R www-data:www-data /var/log/daloradius.log
# Expose Web port for daloRADIUS
EXPOSE 80
# Run the script which executes Apache2 in the foreground as a running process
CMD ["/var/www/html/init.sh"]