-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (46 loc) · 1.58 KB
/
Dockerfile
File metadata and controls
52 lines (46 loc) · 1.58 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
FROM ubuntu:22.04
LABEL author="David Cutting"
LABEL package="FreeNATS"
LABEL url="http://www.purplepixie.org/freenats/"
# Update packages
RUN apt update
RUN apt upgrade -y
# Install Required Software
RUN apt install -y mysql-server
RUN apt install -y apache2
RUN apt install -y cron
RUN apt install -y wget
# TZData Fix (avoids interactive prompt), UTC by default
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
# Required PHP Libraries
RUN apt install -y libapache2-mod-php php-mysql php-imap php-xml php-gd
# FreeNATS Setup and Install
ADD scripts ./scripts
ARG VERSION=
ENV VERSION=${VERSION}
# Install FreeNATS Script
RUN chmod +x scripts/install-freenats.sh
RUN scripts/install-freenats.sh
RUN chmod +x scripts/upgrade-freenats.sh
RUN ln -s /opt/freenats/server/base /var/www/base
RUN rm /etc/apache2/mods-available/alias.conf
# MySQL Setup
RUN service mysql restart \
&& mysql < scripts/fix-root-password.sql \
&& echo "CREATE DATABASE freenats" | mysql \
&& mysql freenats < /opt/freenats/server/base/sql/schema.sql \
&& mysql freenats < /opt/freenats/server/base/sql/default.sql
# CRON Setup
RUN mkdir /etc/cron.minute
RUN echo "* * * * * root run-parts /etc/cron.minute" >> /etc/crontab
RUN cp /scripts/freenats-tester /etc/cron.minute/
RUN cp /scripts/freenats-cleanup /etc/cron.daily/
RUN chmod +x /etc/cron.minute/freenats-tester
RUN chmod +x /etc/cron.daily/freenats-cleanup
# Expose HTTP
EXPOSE 80
# Runtime
CMD service mysql restart \
&& service apache2 restart \
&& service cron restart \
&& tail -f /var/log/apache2/error.log