Skip to content

Commit

Permalink
fix(build): set default php.ini & add .dockerignore
Browse files Browse the repository at this point in the history
  • Loading branch information
hippothomas committed Jan 17, 2024
1 parent dff8998 commit 95054ca
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
**/*.log
**/*.md
**/*.php~
**/*.dist.php
**/*.dist
**/*.cache
**/._*
**/.dockerignore
**/.DS_Store
**/.git/
**/.gitattributes
**/.gitignore
**/.gitmodules
**/compose.*.yaml
**/compose.*.yml
**/compose.yaml
**/compose.yml
**/docker-compose.*.yaml
**/docker-compose.*.yml
**/docker-compose.yaml
**/docker-compose.yml
**/Dockerfile
**/Thumbs.db
.idea/
.github/
docs/
public/bundles/
tests/
var/
vendor/
.editorconfig
.env.*.local
.env.local
.env.local.php
.env.test
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ WORKDIR /var/www/html
# Copy the code into the container
COPY . .

## Set default php.ini
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini

## Copy custom configurations
COPY ./deployment/apache.conf /etc/apache2/sites-available/000-default.conf
COPY ./deployment/php.ini /usr/local/etc/php/conf.d/custom-php.ini

# Install PHP extensions and other dependencies
RUN apt-get update && \
apt-get install -y wget libpq-dev libicu-dev && \
apt-get install -y wget git libpq-dev libicu-dev && \
docker-php-ext-configure pgsql -with-pgsql=/usr/local/pgsql && \
docker-php-ext-install intl opcache pgsql pdo pdo_pgsql && \
pecl install mongodb && \
Expand All @@ -27,8 +30,11 @@ RUN wget https://getcomposer.org/installer && \
php installer --install-dir=/usr/local/bin/ --filename=composer && \
rm installer

## Install application dependencies
## Setting env
ENV APP_ENV=prod
ENV COMPOSER_ALLOW_SUPERUSER=1

## Install application dependencies
RUN composer install --no-dev --no-interaction --optimize-autoloader

## Change files owner to apache default user
Expand Down

0 comments on commit 95054ca

Please sign in to comment.