-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Dockerfile stages, hadolint + CI
- Loading branch information
1 parent
1e321b3
commit aeff473
Showing
4 changed files
with
23 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,14 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
lint: | ||
name: Lint Dockerfile | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: hadolint/[email protected] | ||
|
||
build: | ||
name: PHP | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function hadolint() { | ||
docker run --rm -i -v ./hadolint.yaml:/.config/hadolint.yaml hadolint/hadolint < Dockerfile | ||
} | ||
|
||
echo hadolint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
ARG PHP_VERSION | ||
ARG PHP_EXTENSIONS | ||
|
||
FROM php:${PHP_VERSION}-fpm | ||
FROM mlocati/php-extension-installer:2 as extension-installer | ||
FROM php:${PHP_VERSION}-fpm as base | ||
FROM base | ||
|
||
WORKDIR /usr/local/etc/php/conf.d/ | ||
COPY --link symfony.ini . | ||
WORKDIR /usr/local/etc/php/pool.d/ | ||
COPY --link symfony.pool.conf . | ||
WORKDIR /usr/local/etc/php | ||
COPY --link symfony.ini ./conf.d/ | ||
COPY --link symfony.pool.conf ./pool.d/ | ||
|
||
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ | ||
COPY --from=extension-installer /usr/bin/install-php-extensions /usr/local/bin | ||
|
||
RUN install-php-extensions ${PHP_EXTENSIONS} | ||
RUN install-php-extensions "${PHP_EXTENSIONS}" | ||
|
||
RUN usermod -u 1000 www-data | ||
RUN usermod -G staff www-data | ||
RUN usermod -u 1000 www-data && usermod -G staff www-data | ||
|
||
WORKDIR /var/www/symfony |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
failure-threshold: style |