Skip to content

Commit

Permalink
Merge pull request #100 from jdel/fix/container
Browse files Browse the repository at this point in the history
Fix version of alpine and upgrade php and composer
  • Loading branch information
jdel authored Jan 31, 2023
2 parents 6651003 + 7b36843 commit fd56672
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

- name: Docker metadata
id: metadata
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: |
${{ github.repository }}
Expand All @@ -56,22 +56,22 @@ jobs:
type=semver,pattern=v{{major}}
- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ github.repository_owner }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
if: ${{ github.event_name != 'pull_request' }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }}
Expand Down
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:edge
FROM alpine:3.17
LABEL maintainer="Julien Del-Piccolo <[email protected]>"
LABEL branch=${BRANCH}
LABEL commit=${COMMIT}
Expand All @@ -7,19 +7,20 @@ USER root

COPY . /var/www/localhost/htdocs/

RUN apk update && apk add --no-cache ca-certificates curl apache2 php8-apache2 php8-phar php8-ctype php8-json \
&& apk add --virtual=.build-dependencies openssl php8 php8-openssl php8-iconv php8-mbstring git \
RUN apk update && apk add --no-cache ca-certificates curl apache2 php81-apache2 php81-phar php81-ctype php81-json \
&& apk add --virtual=.build-dependencies openssl php81 php81-openssl php81-iconv php81-mbstring git \
&& ln -sf /usr/bin/php81 /usr/local/bin/php \
&& rm -f /var/www/localhost/htdocs/index.html \
&& curl -sSL https://getcomposer.org/download/2.2.6/composer.phar -o /usr/local/bin/composer \
&& curl -sSL https://getcomposer.org/download/2.5.1/composer.phar -o /usr/local/bin/composer \
&& chmod +x /usr/local/bin/composer \
&& cd /var/www/localhost/htdocs \
&& composer install --no-dev \
; rm -f /usr/local/bin/composer \
&& rm -f /usr/local/bin/composer \
&& apk del .build-dependencies \
&& rm -rf /var/cache/apk/* \
&& mkdir -p /run/apache2 \
&& sed -i 's/Listen 80/Listen 8080/' /etc/apache2/httpd.conf \
&& sed -i 's/^variables_order = "GPCS"/variables_order = "EGPCS"/' /etc/php8/php.ini \
&& sed -i 's/^variables_order = "GPCS"/variables_order = "EGPCS"/' /etc/php81/php.ini \
&& ln -sf /dev/stdout /var/log/apache2/access.log \
&& ln -sf /dev/stderr /var/log/apache2/error.log \
&& ln -sf /var/www/localhost/htdocs/packages /packages \
Expand Down

0 comments on commit fd56672

Please sign in to comment.