|
| 1 | +FROM ruby:3.4-bullseye |
| 2 | + |
| 3 | +ENV LC_ALL=en_US.UTF-8 |
| 4 | + |
| 5 | +RUN set -ex \ |
| 6 | + && apt-get update \ |
| 7 | + && apt-get upgrade -y \ |
| 8 | + && apt-get install -y --no-install-recommends \ |
| 9 | + ca-certificates \ |
| 10 | + apt-transport-https \ |
| 11 | + supervisor \ |
| 12 | + openssh-server \ |
| 13 | + cron \ |
| 14 | + locales \ |
| 15 | + net-tools \ |
| 16 | + dnsutils \ |
| 17 | + rsync \ |
| 18 | + screen \ |
| 19 | + curl \ |
| 20 | + wget \ |
| 21 | + gnupg \ |
| 22 | + vim \ |
| 23 | + git-core \ |
| 24 | + logrotate \ |
| 25 | + && apt-get clean \ |
| 26 | + && rm -rf /var/lib/apt/lists/* |
| 27 | + |
| 28 | +RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \ |
| 29 | + && locale-gen \ |
| 30 | + && update-locale LANG=en_US.UTF-8 LANGUAGE=en_US:en: |
| 31 | + |
| 32 | +RUN mkdir -p /var/log/supervisor \ |
| 33 | + && echo '[supervisord]\nnodaemon=true' >> /etc/supervisor/conf.d/supervisord.conf \ |
| 34 | + && echo '[program:cron]\ncommand=/usr/sbin/cron -f' >> /etc/supervisor/conf.d/cron.conf \ |
| 35 | + && mkdir -p /var/run/sshd \ |
| 36 | + && echo '[program:sshd]\ncommand=/usr/sbin/sshd -D' >> /etc/supervisor/conf.d/sshd.conf |
| 37 | + |
| 38 | +RUN wget -O - https://openresty.org/package/pubkey.gpg | apt-key add - \ |
| 39 | + && codename=$(grep -Po 'VERSION="[0-9]+ \(\K[^)]+' /etc/os-release) \ |
| 40 | + && if [ "$(uname -m)" = "x86_64" ] || [ "$(uname -m)" = "amd64" ]; then \ |
| 41 | + echo "deb http://openresty.org/package/debian $codename openresty" | tee /etc/apt/sources.list.d/openresty.list; \ |
| 42 | + elif [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ]; then \ |
| 43 | + echo "deb http://openresty.org/package/arm64/debian $codename openresty" | tee /etc/apt/sources.list.d/openresty.list; \ |
| 44 | + else \ |
| 45 | + echo "Unsupported architecture"; \ |
| 46 | + exit 1; \ |
| 47 | + fi \ |
| 48 | + && apt-get update \ |
| 49 | + && apt-get install -y --no-install-recommends openresty \ |
| 50 | + && apt-get clean \ |
| 51 | + && rm -rf /var/lib/apt/lists/* \ |
| 52 | + && echo '[program:openresty]\ncommand=/usr/bin/openresty -g "daemon off;"' >> /etc/supervisor/conf.d/openresty.conf |
| 53 | + |
| 54 | +RUN curl -sL https://deb.nodesource.com/setup_22.x | bash - \ |
| 55 | + && apt-get update \ |
| 56 | + && apt-get install -y --no-install-recommends nodejs \ |
| 57 | + && apt-get clean \ |
| 58 | + && rm -rf /var/lib/apt/lists/* |
| 59 | + |
| 60 | +WORKDIR /opt |
| 61 | + |
| 62 | +EXPOSE 22 80 |
| 63 | + |
| 64 | +CMD ["sh", "-c", "env >> /etc/environment ; /usr/bin/supervisord"] |
0 commit comments