Skip to content

Commit

Permalink
add improvements based on review in #25
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbeig committed Oct 25, 2024
1 parent 272c520 commit 6e52d20
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
8 changes: 2 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@ services:
php:
build:
context: .
dockerfile: Dockerfile
dockerfile: docker/php/Dockerfile
target: dev
container_name: goteo-v4-php
volumes:
- .:/app
- ./docker/php/conf.d/apc.ini:/usr/local/etc/php/conf.d/apc.ini:ro
- ./docker/php/conf.d/opcache.ini:/usr/local/etc/php/conf.d/opcache.ini:ro
environment:
XDEBUG_MODE: debug
XDEBUG_CONFIG: "client_host=host.docker.internal"
APP_ENV: development
APP_DEBUG: true
env_file: ".env.local"
ports:
- "9000:9000"
- "9003:9003"
Expand Down
17 changes: 10 additions & 7 deletions Dockerfile → docker/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,29 @@ RUN apk --no-cache add \
unzip

RUN docker-php-ext-install \
opcache \
pdo \
pdo_mysql \
pdo_mysql

RUN docker-php-ext-install \
intl \
zip

COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
COPY --from=composer:lts /usr/bin/composer /usr/local/bin/composer

WORKDIR /app

FROM base AS dev

RUN apk --no-cache add $PHPIZE_DEPS \
&& pecl install xdebug \
RUN docker-php-ext-install opcache

RUN apk --no-cache add $PHPIZE_DEPS
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug

COPY . /app

RUN chown -R www-data:www-data /app

USER www-data
WORKDIR /app

RUN composer install --prefer-dist --no-scripts

Expand All @@ -40,6 +42,7 @@ COPY . /app
RUN chown -R www-data:www-data /app

USER www-data
WORKDIR /app

RUN composer install --prefer-dist --no-scripts --no-dev --optimize-autoloader

Expand Down

0 comments on commit 6e52d20

Please sign in to comment.