Skip to content

Commit 11fdc7f

Browse files
committed
Modify dockerfile
1 parent 250f7e2 commit 11fdc7f

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
with:
5454
context: .
5555
push: true
56-
platforms: linux/amd64,linux/arm64,linux/arm/v7
56+
platforms: linux/amd64
5757
cache-from: type=gha
5858
cache-to: type=gha,mode=max
5959
tags: |

Dockerfile

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ FROM debian:12-slim
55
ARG DEBIAN_FRONTEND=noninteractive
66
ENV APP_DIR=/srv/keys COMPOSER_ALLOW_SUPERUSER=1
77

8-
RUN apt-get update && apt-get install -y --no-install-recommends nginx php-fpm php-cli php-mysql php-ldap php-mbstring php-gmp php-xml php-zip php-curl php-gd php-intl php-bcmath composer cron supervisor tini ca-certificates curl git openssh-client unzip && rm -rf /var/lib/apt/lists/*
8+
RUN apt-get update && apt-get install -y --no-install-recommends \
9+
nginx php-fpm php-cli php-mysql php-ldap php-mbstring php-gmp php-xml php-zip php-curl php-gd \
10+
php-intl php-bcmath composer cron supervisor tini ca-certificates curl openssh-client && rm -rf /var/lib/apt/lists/*
911

1012
RUN useradd --system --home /var/lib/keys-sync --shell /usr/sbin/nologin keys-sync && \
1113
mkdir -p /var/lib/keys-sync /var/log/ska /var/local/keys-sync /var/log/supervisor && \
@@ -19,9 +21,20 @@ COPY . ${APP_DIR}
1921

2022
RUN composer install --no-dev --prefer-dist --optimize-autoloader
2123

22-
RUN set -eux; PHP_VERSION="$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')"; FPM_DIR="/etc/php/${PHP_VERSION}/fpm"; sed -ri 's|^listen = .+|listen = 9000|' "${FPM_DIR}/pool.d/www.conf"; sed -ri 's|^;*daemonize = yes|daemonize = no|' "${FPM_DIR}/php-fpm.conf"; sed -ri 's|^;*clear_env = .+|clear_env = no|' "${FPM_DIR}/pool.d/www.conf"; sed -ri 's|^;*catch_workers_output = .*|catch_workers_output = yes|' "${FPM_DIR}/pool.d/www.conf"; mkdir -p /run/php /var/lib/php/sessions; ln -sf "/usr/sbin/php-fpm${PHP_VERSION}" /usr/sbin/php-fpm; chown www-data:www-data /run/php /var/lib/php/sessions; chmod 1733 /var/lib/php/sessions
23-
24-
RUN set -eux; cat <<'NGINX-EOF' >/etc/nginx/nginx.conf; printf '\n' >>/etc/nginx/nginx.conf
24+
RUN set -eux; \
25+
PHP_VERSION="$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')"; \
26+
FPM_DIR="/etc/php/${PHP_VERSION}/fpm"; \
27+
sed -ri 's|^listen = .+|listen = 9000|' "${FPM_DIR}/pool.d/www.conf"; \
28+
sed -ri 's|^;*daemonize = yes|daemonize = no|' "${FPM_DIR}/php-fpm.conf"; \
29+
sed -ri 's|^;*clear_env = .+|clear_env = no|' "${FPM_DIR}/pool.d/www.conf"; \
30+
sed -ri 's|^;*catch_workers_output = .*|catch_workers_output = yes|' "${FPM_DIR}/pool.d/www.conf"; \
31+
mkdir -p /run/php /var/lib/php/sessions; \
32+
ln -sf "/usr/sbin/php-fpm${PHP_VERSION}" /usr/sbin/php-fpm; \
33+
chown www-data:www-data /run/php /var/lib/php/sessions; \
34+
chmod 1733 /var/lib/php/sessions
35+
36+
RUN set -eux; \
37+
cat <<'NGINX-EOF' >/etc/nginx/nginx.conf; printf '\n' >>/etc/nginx/nginx.conf
2538
worker_processes auto;
2639

2740
error_log /dev/stderr info;
@@ -75,7 +88,8 @@ http {
7588
}
7689
NGINX-EOF
7790

78-
RUN set -eux; cat <<'CRON-EOF' >/etc/cron.d/ska; printf '\n' >>/etc/cron.d/ska; chmod 0644 /etc/cron.d/ska
91+
RUN set -eux; \
92+
cat <<'CRON-EOF' >/etc/cron.d/ska; printf '\n' >>/etc/cron.d/ska; chmod 0644 /etc/cron.d/ska
7993
SHELL=/bin/bash
8094
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
8195

docker-compose.yml.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
ska-app:
33
build: .
4-
image: ska-app:dev
4+
image: msprg/ssh-key-authority
55
container_name: ska-app
66
restart: unless-stopped
77
depends_on:

0 commit comments

Comments
 (0)