Added alpine linux php-apache base image
This commit is contained in:
parent
47188ff9db
commit
f9879a0ffb
|
@ -1,4 +1,4 @@
|
|||
name: Build and Push Alpine PHP 8.3 Image
|
||||
name: Build and Push Alpine PHP Image
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
|
@ -116,4 +116,118 @@ jobs:
|
|||
tags: |
|
||||
aprimediet/php:8-alpine
|
||||
aprimediet/php:8.3-alpine
|
||||
aprimediet/php:latest-alpine
|
||||
aprimediet/php:latest-alpine
|
||||
build-apache:
|
||||
name: Build and push apache image
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build
|
||||
container:
|
||||
image: ghcr.io/catthehacker/ubuntu:act-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
- name: Login to Docker Winter Access Git Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: docker.io
|
||||
username: aprimediet
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Build and push 5.6 with Apache2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.apache-alpine
|
||||
build-args: |
|
||||
REGISTRY_URL=docker.io/aprimediet
|
||||
ALPINE_VERSION=3.5
|
||||
PHP_VERSION=5
|
||||
push: true
|
||||
tags: |
|
||||
aprimediet/php:5.6-apache-alpine
|
||||
- name: Build and push 7.2 with Apache2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.apache-alpine
|
||||
build-args: |
|
||||
REGISTRY_URL=docker.io/aprimediet
|
||||
ALPINE_VERSION=3.9
|
||||
PHP_VERSION=7
|
||||
push: true
|
||||
tags: |
|
||||
aprimediet/php:7.2-apache-alpine
|
||||
- name: Build and push 7.3 with Apache2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.apache-alpine
|
||||
build-args: |
|
||||
REGISTRY_URL=docker.io/aprimediet
|
||||
ALPINE_VERSION=3.10
|
||||
PHP_VERSION=7
|
||||
push: true
|
||||
tags: |
|
||||
aprimediet/php:7.3-apache-alpine
|
||||
- name: Build and push 7.4 with Apache2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.apache-alpine
|
||||
build-args: |
|
||||
REGISTRY_URL=docker.io/aprimediet
|
||||
ALPINE_VERSION=3.13
|
||||
PHP_VERSION=7
|
||||
push: true
|
||||
tags: |
|
||||
aprimediet/php:7.4-apache-alpine
|
||||
- name: Build and push 8.0 with Apache2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.apache-alpine
|
||||
build-args: |
|
||||
REGISTRY_URL=docker.io/aprimediet
|
||||
ALPINE_VERSION=3.16
|
||||
PHP_VERSION=8
|
||||
push: true
|
||||
tags: |
|
||||
aprimediet/php:8.0-apache-alpine
|
||||
- name: Build and push 8.1 with Apache2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.apache-alpine
|
||||
build-args: |
|
||||
REGISTRY_URL=docker.io/aprimediet
|
||||
ALPINE_VERSION=3.18
|
||||
PHP_VERSION=81
|
||||
push: true
|
||||
tags: |
|
||||
aprimediet/php:8.1-apache-alpine
|
||||
- name: Build and push 8.2 with Apache2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.apache-alpine
|
||||
build-args: |
|
||||
REGISTRY_URL=docker.io/aprimediet
|
||||
ALPINE_VERSION=3.18
|
||||
PHP_VERSION=82
|
||||
push: true
|
||||
tags: |
|
||||
aprimediet/php:8.2-apache-alpine
|
||||
- name: Build and push 8.3 with Apache2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.apache-alpine
|
||||
build-args: |
|
||||
REGISTRY_URL=docker.io/aprimediet
|
||||
ALPINE_VERSION=3.19
|
||||
PHP_VERSION=83
|
||||
push: true
|
||||
tags: |
|
||||
aprimediet/php:8-apache-alpine
|
||||
aprimediet/php:8.3-apache-alpine
|
||||
aprimediet/php:latest-apache-alpine
|
|
@ -1,4 +1,4 @@
|
|||
name: Build and Push Alpine PHP 8.3 Image
|
||||
name: Build and Push Alpine PHP Image
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
|
@ -107,4 +107,110 @@ jobs:
|
|||
push: true
|
||||
tags: |
|
||||
git.winteraccess.id/${{ gitea.repository }}:8.3-alpine
|
||||
git.winteraccess.id/${{ gitea.repository }}:latest-alpine
|
||||
git.winteraccess.id/${{ gitea.repository }}:latest-alpine
|
||||
build-apache:
|
||||
name: Build and push apache image
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build
|
||||
container:
|
||||
image: ghcr.io/catthehacker/ubuntu:act-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
- name: Login to Docker Winter Access Git Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.winteraccess.id
|
||||
username: aditya.prima
|
||||
password: ${{ secrets.PATOKEN }}
|
||||
- name: Build and push 5.6 with Apache2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.apache-alpine
|
||||
build-args: |
|
||||
ALPINE_VERSION=3.5
|
||||
PHP_VERSION=5
|
||||
push: true
|
||||
tags: |
|
||||
git.winteraccess.id/${{ gitea.repository }}:5.6-apache-alpine
|
||||
- name: Build and push 7.2 with Apache2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.apache-alpine
|
||||
build-args: |
|
||||
ALPINE_VERSION=3.9
|
||||
PHP_VERSION=7
|
||||
push: true
|
||||
tags: |
|
||||
git.winteraccess.id/${{ gitea.repository }}:7.2-apache-alpine
|
||||
- name: Build and push 7.3 with Apache2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.apache-alpine
|
||||
build-args: |
|
||||
ALPINE_VERSION=3.10
|
||||
PHP_VERSION=7
|
||||
push: true
|
||||
tags: |
|
||||
git.winteraccess.id/${{ gitea.repository }}:7.3-apache-alpine
|
||||
- name: Build and push 7.4 with Apache2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.apache-alpine
|
||||
build-args: |
|
||||
ALPINE_VERSION=3.13
|
||||
PHP_VERSION=7
|
||||
push: true
|
||||
tags: |
|
||||
git.winteraccess.id/${{ gitea.repository }}:7.4-apache-alpine
|
||||
- name: Build and push 8.0 with Apache2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.apache-alpine
|
||||
build-args: |
|
||||
ALPINE_VERSION=3.16
|
||||
PHP_VERSION=8
|
||||
push: true
|
||||
tags: |
|
||||
git.winteraccess.id/${{ gitea.repository }}:8.0-apache-alpine
|
||||
- name: Build and push 8.1 with Apache2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.apache-alpine
|
||||
build-args: |
|
||||
ALPINE_VERSION=3.18
|
||||
PHP_VERSION=81
|
||||
push: true
|
||||
tags: |
|
||||
git.winteraccess.id/${{ gitea.repository }}:8.1-apache-alpine
|
||||
- name: Build and push 8.2 with Apache2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.apache-alpine
|
||||
build-args: |
|
||||
ALPINE_VERSION=3.18
|
||||
PHP_VERSION=82
|
||||
push: true
|
||||
tags: |
|
||||
git.winteraccess.id/${{ gitea.repository }}:8.2-apache-alpine
|
||||
- name: Build and push 8.3 with Apache2
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.apache-alpine
|
||||
build-args: |
|
||||
ALPINE_VERSION=3.19
|
||||
PHP_VERSION=83
|
||||
push: true
|
||||
tags: |
|
||||
git.winteraccess.id/${{ gitea.repository }}:8-apache-alpine
|
||||
git.winteraccess.id/${{ gitea.repository }}:8.3-apache-alpine
|
||||
git.winteraccess.id/${{ gitea.repository }}:latest-apache-alpine
|
|
@ -0,0 +1,48 @@
|
|||
ARG REGISTRY_URL=git.winteraccess.id/docker
|
||||
ARG PHP_VERSION=8.3
|
||||
|
||||
FROM ${REGISTRY_URL}/php:${PHP_VERSION}-alpine
|
||||
LABEL maintainer "<Muhamad Aditya Prima> aprimediet@gmail.com"
|
||||
|
||||
# DEFINE ENV
|
||||
ENV SERVER_ROOT /app
|
||||
ENV SERVER_ADMIN you@example.com
|
||||
ENV APP_DIR ${SERVER_ROOT}/htdocs
|
||||
ENV LOG_LEVEL info
|
||||
ENV PHP_MEMORY_LIMIT 256M
|
||||
|
||||
# SET WORKDIR
|
||||
WORKDIR /tmp
|
||||
|
||||
# INSTALL APACHE2
|
||||
RUN --mount=type=cache,target=/var/cache/apk \
|
||||
apk upgrade && apk add --update \
|
||||
apache2 php${PHP_VERSION}-apache2
|
||||
|
||||
# CREATE SYMLINKS TO /app
|
||||
RUN mkdir -p /app/htdocs && \
|
||||
ln -s /var/log/apache2 /app/logs && \
|
||||
ln -s /usr/lib/apache2 /app/modules && \
|
||||
ln -s /run/apache2 /app/run
|
||||
|
||||
# CONFIGURE HTTPD
|
||||
RUN sed -i "s|ServerRoot /var/www|ServerRoot ${SERVER_ROOT}|" /etc/apache2/httpd.conf && \
|
||||
sed -i "s|ServerAdmin you@example.com| ServerAdmin ${SERVER_ADMIN}|" /etc/apache2/httpd.conf && \
|
||||
sed -i "s|DocumentRoot \"/var/www/localhost/htdocs\"|DocumentRoot \"${APP_DIR}\"|" /etc/apache2/httpd.conf && \
|
||||
sed -i "s|Directory \"/var/www/localhost/htdocs\"|Directory \"${APP_DIR}\"|" /etc/apache2/httpd.conf && \
|
||||
sed -i "s|AllowOverride None|AllowOverride All|" /etc/apache2/httpd.conf && \
|
||||
sed -i "s|ErrorLog .*|ErrorLog /dev/stderr \nTransferLog /dev/stdout|" /etc/apache2/httpd.conf && \
|
||||
sed -i "s|CustomLog .* combined|CustomLog /dev/stdout combined|" /etc/apache2/httpd.conf && \
|
||||
sed -i "s|LogLevel .*|LogLevel ${LOG_LEVEL}|" /etc/apache2/httpd.conf
|
||||
|
||||
# ADD INITIALIZATION SCRIPT
|
||||
ADD ./scripts/apache-entrypoint-alpine /usr/local/bin/entrypoint
|
||||
RUN chmod +x /usr/local/bin/entrypoint && \
|
||||
cp -vR /var/www/localhost/htdocs/* ${APP_DIR}/ && \
|
||||
chown -R apache:apache ${APP_DIR}
|
||||
|
||||
WORKDIR ${APP_DIR}
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint"]
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "RUNNING APACHE2"
|
||||
|
||||
httpd -D FOREGROUND
|
Loading…
Reference in New Issue