Skip to content

Commit

Permalink
Ensure that production php.ini is used in the final image
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackenmen committed Apr 25, 2023
1 parent 5e56270 commit e2c2fb1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
10 changes: 9 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
FROM docker.io/php:7.4-fpm
FROM docker.io/php:7.4-fpm AS base

COPY ./public /opt/index/public

WORKDIR /opt/index/public

CMD ["php-fpm"]

FROM base AS dev

RUN cp "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

FROM base

RUN cp "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
serve:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build
4 changes: 3 additions & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ networks:

services:
app:
build: .
build:
context: .
target: dev
volumes:
- ./public:/opt/index/public
networks:
Expand Down

0 comments on commit e2c2fb1

Please sign in to comment.