Skip to content

Commit

Permalink
Actions: Build ARM64 dev base image (#1169)
Browse files Browse the repository at this point in the history
* Actions: Build ARM64 dev base image

* Remove xdebug from prod dockerfile and point error log to stderr

* Fix apache crashing on startup
  • Loading branch information
markspolakovs authored Sep 15, 2024
1 parent f8e9cf7 commit f280efc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/dev-base-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,22 @@ jobs:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.ref || 'master' }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker Login
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the Docker image
run: docker build . --file Dockerfile --tag ghcr.io/universityradioyork/myradio/dev-base:${{ github.event.inputs.docker-tag || 'latest' }}
- name: Push
run: docker push ghcr.io/universityradioyork/myradio/dev-base:${{ github.event.inputs.docker-tag || 'latest' }}

- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/universityradioyork/myradio/dev-base:${{ github.event.inputs.docker-tag || 'latest' }}
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ RUN openssl req -nodes -new -subj "/C=GB/ST=North Yorkshire/L=York/O=University

RUN a2enmod rewrite ssl

# Fixes for running on ARM
RUN echo "Mutex posixsem" >> /etc/apache2/apache2.conf

COPY sample_configs/apache.conf /etc/apache2/sites-available/myradio.conf
RUN a2dissite 000-default && a2ensite myradio && \
service apache2 restart && apachectl -S
Expand Down
10 changes: 2 additions & 8 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ RUN docker-php-ext-install pgsql pdo_pgsql gd ldap curl xsl zip
RUN pecl install memcached && \
echo extension=memcached.so >> /usr/local/etc/php/conf.d/memcached.ini

RUN pecl install xdebug-3.3.1 && docker-php-ext-enable xdebug \
&& echo 'zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20220829/xdebug.so"' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo 'xdebug.client_port=9003' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo 'xdebug.mode=develop,debug' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo 'xdebug.start_with_request=yes' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo 'xdebug.client_host=localhost' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

RUN echo 'error_reporting=E_ALL' >> /usr/local/etc/php/conf.d/error-reporting.ini

RUN echo "memory_limit=512M" >> /usr/local/etc/php/conf.d/uploads.ini
Expand All @@ -40,7 +33,8 @@ RUN a2dissite 000-default && a2ensite myradio && \
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

RUN mkdir -p /var/www/myradio && chown -R www-data:www-data /var/www/myradio && \
mkdir -p /var/log/myradio && chown -R www-data:www-data /var/log/myradio
mkdir -p /var/log/myradio && chown -R www-data:www-data /var/log/myradio && \
ln -s /var/log/myradio/errors.log /dev/stderr

WORKDIR /var/www/myradio
COPY composer.* /var/www/myradio/
Expand Down

0 comments on commit f280efc

Please sign in to comment.