-
-
Notifications
You must be signed in to change notification settings - Fork 903
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker image based on PHP 8 and in GitHub Container Registry
- Loading branch information
1 parent
b301465
commit 78ba59e
Showing
3 changed files
with
76 additions
and
0 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
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,47 @@ | ||
# From: | ||
# https://www.docker.com/blog/docker-github-actions/ | ||
# https://github.com/metcalfc/docker-action-examples | ||
|
||
name: Docker image nightly | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
paths-ignore: | ||
- 'website/**' | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Login to ghcr | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GHCR_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: ./docker | ||
file: ./docker/Dockerfile | ||
push: true | ||
tags: ghcr.io/phpstan/phpstan:nightly |
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,28 @@ | ||
FROM php:8.0.0RC5-cli-alpine | ||
|
||
RUN php --version | ||
|
||
ENV COMPOSER_HOME /composer | ||
ENV COMPOSER_ALLOW_SUPERUSER 1 | ||
ENV PATH /composer/vendor/bin:$PATH | ||
ENV PHP_CONF_DIR=/usr/local/etc/php/conf.d | ||
|
||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer | ||
|
||
RUN echo "memory_limit=-1" > $PHP_CONF_DIR/99_memory-limit.ini \ | ||
&& apk add git \ | ||
&& rm -rf /var/cache/apk/* /var/tmp/* /tmp/* | ||
|
||
ARG PHPSTAN_VERSION | ||
|
||
RUN composer global require phpstan/phpstan:"$PHPSTAN_VERSION" \ | ||
&& rm -rf /composer/vendor/phpstan/phpstan/.git \ | ||
&& composer clear-cache | ||
|
||
VOLUME ["/app"] | ||
WORKDIR /app | ||
|
||
ENV PHPSTAN_PRO_WEB_PORT=11111 | ||
EXPOSE 11111 | ||
|
||
ENTRYPOINT ["phpstan"] |