Skip to content

Commit

Permalink
Layered Dockerfile and removed armv7 from build step on github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
paulotruta committed Dec 8, 2024
1 parent 7365d17 commit cf28ce1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: ./
platforms: linux/amd64,linux/arm/v7,linux/arm64
platforms: linux/amd64,linux/arm64
push: false
# tags: ghcr.io/edgebox-iot/api:${{ github.ref_name }},ghcr.io/edgebox-iot/api:latest
test:
Expand Down
40 changes: 18 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1-apache-buster
FROM php:8.1-apache as php-base

ARG DEBIAN_FRONTEND=noninteractive

Expand All @@ -22,22 +22,17 @@ RUN apt-get -y update --fix-missing \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
&& rm -rf /var/lib/apt/lists/*

# Additional packages that might be removed
# libmagickwand-dev \

# Install PHP Extensions
RUN docker-php-ext-install \
pdo_sqlite \
mysqli \
curl \
zip \
intl \
mbstring \
gettext \
exif \
gd
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install \
pdo_sqlite \
mysqli \
curl \
zip \
intl \
mbstring \
gettext \
exif \
gd

# Install additional PHP Extensions
# RUN pecl install xdebug-3.2.0 \
Expand All @@ -47,19 +42,20 @@ RUN docker-php-ext-install \
# && pecl install imagick \
# && docker-php-ext-enable imagick

# Enable apache modules
# RUN a2enmod rewrite headers
FROM php-base as final

# Layering Composer binary
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
COPY ./src/composer.json ./src/composer.lock ./

# Add Source Code
# Copy application code (most frequently changed)
COPY ./src /var/www/html

ENV APP_ENV=prod

# Install Composer Dependencies
RUN composer install --no-dev --optimize-autoloader

# Cleanup
RUN rm -rf /usr/src/*

# Configure apache if needed
# RUN a2enmod rewrite headers

0 comments on commit cf28ce1

Please sign in to comment.