add alpine build
Some checks failed
ci/woodpecker/push/build Pipeline failed

This commit is contained in:
Ruben Momoa
2024-08-22 11:19:09 +02:00
parent d3b38ddf77
commit 6cb5666991
3 changed files with 66 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
steps:
release_build_and_publish:
release_ubuntu_build_and_publish:
image: woodpeckerci/plugin-docker-buildx
settings:
username: vistanarvas
@@ -8,12 +8,14 @@ steps:
context: ./build
repo: vistanarvas/${CI_REPO_NAME}
auto_tag: true
default_suffix: -ubuntu
dockerfile: Dockerfile_alpine
when:
branch:
include: [ main, master ]
event: release
cron_build_and_publish:
cron_ubuntu_build_and_publish:
image: woodpeckerci/plugin-docker-buildx
settings:
username: vistanarvas
@@ -21,16 +23,17 @@ steps:
from_secret: DOCKERHUB_TOKEN
context: ./build
repo: vistanarvas/${CI_REPO_NAME}
tag: nightly
tag: nightly-ubuntu
dockerfile: Dockerfile_alpine
when:
branch:
include: [ main, master ]
path:
include: [ '.woodpecker/build.yml', 'build/*', 'Dockerfile' ]
include: [ '.woodpecker/build.yml', 'build/*', 'Dockerfile_ubuntu' ]
cron: nightly
event: [ cron ]
dev_build_and_publish:
dev_ubuntu_build_and_publish:
image: woodpeckerci/plugin-docker-buildx
settings:
username: vistanarvas
@@ -38,10 +41,28 @@ steps:
from_secret: DOCKERHUB_TOKEN
context: ./build
repo: vistanarvas/${CI_REPO_NAME}
tag: ${CI_COMMIT_BRANCH}
tag: ${CI_COMMIT_BRANCH}-ubuntu
dockerfile: Dockerfile_alpine
when:
branch:
exclude: [ main, master ]
path:
include: [ '.woodpecker/build.yml', 'build/*', 'Dockerfile' ]
include: [ '.woodpecker/build.yml', 'build/*', 'Dockerfile_ubuntu' ]
event: [ push, manual ]
dev_alpine_build_and_publish:
image: woodpeckerci/plugin-docker-buildx
settings:
username: vistanarvas
password:
from_secret: DOCKERHUB_TOKEN
context: ./build
repo: vistanarvas/${CI_REPO_NAME}
tag: ${CI_COMMIT_BRANCH}-alpine
dockerfile: Dockerfile_alpine
when:
branch:
exclude: [ main, master ]
path:
include: [ '.woodpecker/build.yml', 'build/*', 'Dockerfile_alpine' ]
event: [ push, manual ]

38
Dockerfile_alpine Normal file
View File

@@ -0,0 +1,38 @@
FROM php:8-fpm-alpine
# node version number like "12.22.1" or empty for the latest version
ARG NODE_VERSION=''
# composer version number like "2.1" or empty for the latest version
ARG COMPOSER_VERSION=''
ENV NVM_DIR="/root/.nvm"
# port to for the webserver
ENV WEBSERVER_PORT=8080
COPY start-container.sh /usr/local/bin/start-container
RUN docker-php-ext-install ctype curl dom fileinfo filter hash mbstring openssl pcre pdo session tokenizer xml \
&& chmod +x /usr/local/bin/start-container \
&& echo "install composer" \
&& curl -o composer-setup.php https://getcomposer.org/installer \
&& curl -o composer-setup.sig https://composer.github.io/installer.sig \
&& echo " composer-setup.php" >> composer-setup.sig \
&& sha384sum -c composer-setup.sig \
&& if [ -n "$COMPOSER_VERSION" ]; then COMPOSER_VERSION="--${COMPOSER_VERSION}"; fi \
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer $COMPOSER_VERSION \
&& rm composer-setup.php composer-setup.sig /var/www/html/* \
&& chown $USERNAME:$USERNAME /var/www/html \
&& echo "install nvm and node" \
&& curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash \
&& if [ -z "$NODE_VERSION" ]; then NODE_VERSION="node"; fi \
&& [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION;
EXPOSE ${WEBSERVER_PORT}
WORKDIR /var/www/html
ENTRYPOINT ["start-container"]