Skip to content

Commit

Permalink
feat: add adolint
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Dec 11, 2024
1 parent e19b858 commit ed1ca2e
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 27 deletions.
31 changes: 16 additions & 15 deletions .docker/Dockerfile.apache
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ FROM php:8.1-apache
LABEL vendor="Mautic"
LABEL maintainer="LibreCode coop"

# hadolint ignore=DL3008
RUN apt-get update && apt-get install --no-install-recommends -y \
git \
mariadb-client supervisor cron
git \
mariadb-client supervisor cron && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install PHP extensions
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
Expand All @@ -27,8 +30,6 @@ RUN chmod uga+x /usr/local/bin/install-php-extensions && sync \
zip \
xdebug

RUN echo "memory_limit = -1" > /usr/local/etc/php/php.ini

RUN rm /etc/cron.daily/*

# Setting PHP properties
Expand All @@ -43,11 +44,9 @@ COPY ./scripts/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini

ENV APACHE_DOCUMENT_ROOT=/var/www/html/docroot

RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf

# Enable Apache Rewrite Module
RUN a2enmod rewrite
RUN sed -ri -e "s!/var/www/html!${APACHE_DOCUMENT_ROOT}!g" /etc/apache2/sites-available/*.conf && \
sed -ri -e "s!/var/www/!${APACHE_DOCUMENT_ROOT}!g" /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf && \
a2enmod rewrite

COPY ./scripts/docker-entrypoint.sh /entrypoint.sh
COPY ./scripts/entrypoint_mautic_web.sh /entrypoint_mautic_web.sh
Expand All @@ -68,12 +67,14 @@ ENV DOCKER_MAUTIC_WORKERS_CONSUME_EMAIL=2 \
# Install NVM
ENV NVM_DIR=/usr/local/nvm \
NODE_VERSION=20.18.1
RUN mkdir -p /usr/local/nvm \
&& curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash \
&& . "$NVM_DIR/nvm.sh" \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=SC1091
RUN mkdir -p /usr/local/nvm && \
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash && \
. "$NVM_DIR/nvm.sh" && \
nvm install $NODE_VERSION && \
nvm alias default $NODE_VERSION && \
nvm use default

COPY ./scripts/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

Expand Down
23 changes: 13 additions & 10 deletions .docker/Dockerfile.fpm
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ FROM php:8.1-fpm
LABEL vendor="Mautic"
LABEL maintainer="LibreCode coop"

# hadolint ignore=DL3008
RUN apt-get update && apt-get install --no-install-recommends -y \
git \
mariadb-client supervisor cron
git \
mariadb-client supervisor cron && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install PHP extensions
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
Expand All @@ -27,8 +30,6 @@ RUN chmod uga+x /usr/local/bin/install-php-extensions && sync \
zip \
xdebug

RUN echo "memory_limit = -1" > /usr/local/etc/php/php.ini

RUN rm /etc/cron.daily/*

# Setting PHP properties
Expand Down Expand Up @@ -60,12 +61,14 @@ ENV DOCKER_MAUTIC_WORKERS_CONSUME_EMAIL=2 \
# Install NVM
ENV NVM_DIR=/usr/local/nvm \
NODE_VERSION=20.18.1
RUN mkdir -p /usr/local/nvm \
&& curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash \
&& . "$NVM_DIR/nvm.sh" \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=SC1091
RUN mkdir -p /usr/local/nvm && \
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash && \
. "$NVM_DIR/nvm.sh" && \
nvm install $NODE_VERSION && \
nvm alias default $NODE_VERSION && \
nvm use default

COPY ./scripts/supervisord.conf /etc/supervisor/conf.d/supervisord.conf

Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/hlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Haskell Lint

on:
pull_request:
push:
jobs:
hlint:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HLINT_ACTION_LOG_LEVEL: debug
steps:
- name: Check out
uses: actions/checkout@v4

- name: Lint Apache Dockerfille
uses: hadolint/[email protected]
with:
dockerfile: .docker/Dockerfile.apache

- name: Lint FPM Dockerfille
uses: hadolint/[email protected]
with:
dockerfile: .docker/Dockerfile.fpm
2 changes: 0 additions & 2 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
on:
pull_request:
push:
branches:
- main

name: 'Shellcheck'

Expand Down

0 comments on commit ed1ca2e

Please sign in to comment.