-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
87 lines (69 loc) · 2.48 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
FROM phusion/baseimage:jammy-1.0.1
LABEL by evilalmus
# Set correct environment variables
ENV DEBIAN_FRONTEND noninteractive
ENV HOME /root
ENV LC_ALL C.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV TERM xterm
# Use baseimage-docker's init system
CMD ["/sbin/my_init"]
# Configure user nobody to match unRAID's settings
RUN \
usermod -u 99 nobody && \
usermod -g 100 nobody && \
usermod -d /home nobody && \
chown -R nobody:users /home
RUN apt-get update
RUN apt-get install -qy mc
RUN apt-get install -qy tmux
RUN apt-get install -qy inotify-tools
# Install proxy Dependencies
RUN \
apt-get update -q && \
apt-get install -qy apache2 php && \
apt clean -y && \
a2enmod rewrite && \
rm -rf /var/lib/apt/lists/*
RUN \
service apache2 restart && \
rm -R -f /var/www && \
ln -s /web /var/www
# Update apache configuration with this one
RUN \
mv /etc/apache2/sites-available/000-default.conf /etc/apache2/000-default.conf && \
rm /etc/apache2/sites-available/* && \
rm /etc/apache2/apache2.conf && \
ln -s /config/proxy-config.conf /etc/apache2/sites-available/000-default.conf && \
ln -s /var/log/apache2 /logs
ADD proxy-config.conf /etc/apache2/000-default.conf
ADD apache2.conf /etc/apache2/apache2.conf
ADD ports.conf /etc/apache2/ports.conf
# Manually set the apache environment variables in order to get apache to work immediately.
RUN \
echo www-data > /etc/container_environment/APACHE_RUN_USER && \
echo www-data > /etc/container_environment/APACHE_RUN_GROUP && \
echo /var/log/apache2 > /etc/container_environment/APACHE_LOG_DIR && \
echo /var/lock/apache2 > /etc/container_environment/APACHE_LOCK_DIR && \
echo /var/run/apache2.pid > /etc/container_environment/APACHE_PID_FILE && \
echo /var/run/apache2 > /etc/container_environment/APACHE_RUN_DIR
# Expose Ports
EXPOSE 80 443
# The www directory and proxy config location
VOLUME ["/config", "/web", "/logs"]
# Add our crontab file
ADD crons.conf /root/crons.conf
# Add firstrun.sh to execute during container startup
ADD firstrun.sh /etc/my_init.d/firstrun.sh
RUN chmod +x /etc/my_init.d/firstrun.sh
# Add inotify.sh to execute during container startup
RUN mkdir /etc/service/inotify
ADD inotify.sh /etc/service/inotify/run
RUN chmod +x /etc/service/inotify/run
# Add apache to runit
RUN mkdir /etc/service/apache
ADD apache-run.sh /etc/service/apache/run
RUN chmod +x /etc/service/apache/run
ADD apache-finish.sh /etc/service/apache/finish
RUN chmod +x /etc/service/apache/finish