-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
81 lines (72 loc) · 1.91 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
# - ref: https://github.com/segeda/docker-yaws
# - ref: https://hub.docker.com/r/lfex/yaws
# - ref: https://github.com/lfex/dockerfiles/tree/main/common
# - ref: https://dev.to/jackmiras/laravel-with-php7-4-in-an-alpine-container-3jk6#dockerfile
# - note: Needs Erlang 22 or newer.
# - note: Erlang 26 or newer does not work (some deprecated functions used by yaws). check erlyaws/yaws/issues/467
FROM erlang:22-alpine
RUN apk update && apk upgrade
# Install YAWS
RUN apk add --no-cache --virtual .build-deps \
autoconf \
automake \
g++ \
gawk \
gcc \
libtool \
linux-pam-dev \
make \
git \
&& git clone https://github.com/erlyaws/yaws.git /yaws-src \
&& cd /yaws-src \
&& autoreconf -fi \
&& ./configure --localstatedir=/var --sysconfdir=/etc \
&& make && make install \
&& cd /var \
&& rm -rf /yaws-src \
&& apk del .build-deps
# Install Essentials
RUN echo "UTC" > /etc/timezone
RUN apk add --no-cache zip unzip curl sqlite
# Install bash
RUN apk add bash
RUN sed -i 's/bin\/ash/bin\/bash/g' /etc/passwd
# Install PHP
RUN apk add --no-cache php-cgi \
php-common \
php-fpm \
php-pdo \
php-gd \
php-opcache \
php-zip \
php-phar \
php-iconv \
php-cli \
php-curl \
php-openssl \
php-mbstring \
php-tokenizer \
php-fileinfo \
php-json \
php-xml \
php-xmlwriter \
php-simplexml \
php-dom \
php-pdo_mysql \
php-pdo_sqlite \
php-tokenizer \
php-mysqli \
php-session \
php-ctype
# Set ENV
ENV ERLANG_HOME /usr/local/lib/erlang
ENV YAWS_HOME ${ERLANG_HOME}/lib/yaws-2.1.1/
ENV YAWS_INCLUDE $YAWS_HOME/include
ENV YAWS_CONF /usr/local/etc/yaws
ENV PATH $PATH:$YAWS_HOME/bin
# Compile YAWS Config
COPY yaws $YAWS_CONF
WORKDIR $YAWS_CONF/appmods
RUN erlc processwire.erl
# Entrypoint
ENTRYPOINT [ "yaws", "-i", "--conf", "/usr/local/etc/yaws/yaws.conf" ]