forked from HaxeFoundation/haxelib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
75 lines (63 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
71
72
73
74
75
# Build haxelib server as a Docker container.
# Note that it doesn't contain a MySQL database,
# which need to be launched seperately. See test/docker-compose.yml on how to launch one.
FROM ubuntu:bionic
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common \
&& add-apt-repository ppa:haxe/haxe3.4 -y \
&& apt-get update && apt-get upgrade -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
apache2 \
neko-dev \
haxe \
curl \
git \
libcurl4-gnutls-dev \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
nodejs \
&& rm -r /var/lib/apt/lists/*
# apache httpd
RUN rm -rf /var/www/html \
&& mkdir -p /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html \
&& chown -R www-data:www-data /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html
RUN a2enmod rewrite
RUN a2enmod proxy
RUN a2enmod proxy_http
RUN a2dismod mpm_event
RUN a2enmod mpm_prefork
RUN mv /etc/apache2/apache2.conf /etc/apache2/apache2.conf.dist && rm /etc/apache2/conf-enabled/* /etc/apache2/sites-enabled/*
COPY apache2.conf /etc/apache2/apache2.conf
RUN { \
echo 'LoadModule neko_module /usr/lib/x86_64-linux-gnu/neko/mod_neko2.ndll'; \
echo 'LoadModule tora_module /usr/lib/x86_64-linux-gnu/neko/mod_tora2.ndll'; \
echo 'AddHandler tora-handler .n'; \
} > /etc/apache2/mods-enabled/tora.conf \
&& apachectl stop
# haxelib
ENV HAXELIB_PATH /src/haxelib_global
RUN mkdir -p ${HAXELIB_PATH} && haxelib setup ${HAXELIB_PATH}
WORKDIR /src
COPY libs.hxml run.n /src/
RUN haxe libs.hxml
RUN cp ${HAXELIB_PATH}/aws-sdk-neko/*/ndll/Linux64/aws.ndll /usr/lib/x86_64-linux-gnu/neko/aws.ndll;
COPY server*.hxml /src/
COPY www/package*.json /src/www/
WORKDIR /src/www/
RUN npm install --unsafe-perm
COPY www /src/www/
COPY src/legacyhaxelib/.htaccess /src/www/legacy/
COPY src/legacyhaxelib/haxelib.css /src/www/legacy/
COPY src/legacyhaxelib/website.mtt /src/www/legacy/
COPY src /src/src/
RUN rm -rf /var/www/html
RUN ln -s /src/www /var/www/html
RUN mkdir -p /var/www/html/files
RUN mkdir -p /var/www/html/tmp
WORKDIR /src
RUN haxe server_legacy.hxml
RUN haxe server_website.hxml
RUN haxe server_tasks.hxml
RUN haxe server_api.hxml
EXPOSE 80
VOLUME ["/var/www/html/files", "/var/www/html/tmp"]
CMD apachectl restart && haxelib run tora