-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build .tar.gz file in docker container
- Loading branch information
Showing
9 changed files
with
47 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
FROM php:8.2-fpm-alpine as base | ||
FROM php:8.1-apache as base | ||
|
||
# Use the default production configuration | ||
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" | ||
|
||
COPY app /var/www/html | ||
|
||
FROM base as builder | ||
|
||
# Install php dependencies | ||
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ | ||
RUN chmod uga+x /usr/local/bin/install-php-extensions && sync && \ | ||
install-php-extensions imagick pcntl | ||
|
||
FROM base as builder | ||
install-php-extensions imagick pcntl zip | ||
|
||
# Install composer dependencies | ||
COPY --from=composer /usr/bin/composer /usr/bin/composer | ||
COPY app/composer.* /usr/src/build/ | ||
WORKDIR /usr/src/build | ||
WORKDIR /var/www/html | ||
RUN composer install | ||
|
||
# Create cache | ||
RUN /var/www/html/scripts/christelmusic warmup | ||
|
||
FROM builder as zipper | ||
|
||
RUN tar -czvf /build.tar.gz /var/www/html/* | ||
|
||
FROM base | ||
|
||
COPY app /usr/src/christelmusic.nl | ||
COPY --from=builder /usr/src/build/vendor /usr/src/christelmusic.nl/vendor | ||
RUN /usr/src/christelmusic.nl/scripts/christelmusic warmup | ||
WORKDIR /usr/src/christelmusic.nl | ||
RUN a2enmod rewrite | ||
|
||
COPY --from=builder /var/www/html/vendor /var/www/html/vendor | ||
COPY --from=builder /var/www/html/cache /var/www/html/cache |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
RewriteEngine on | ||
RewriteRule ^(.*)$ public/$1 [QSA,L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Options -Indexes | ||
|
||
RewriteEngine on | ||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteRule ^(.*)$ index.php?PARABLE_REDIRECT_URL=$1 [QSA,L] | ||
|
||
RewriteCond %{HTTPS} off | ||
RewriteRule .* - [E=REQUEST_SCHEME:http] | ||
|
||
RewriteCond %{HTTPS} on | ||
RewriteRule .* - [E=REQUEST_SCHEME:https] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,26 @@ | ||
--- | ||
version: '3.9' | ||
services: | ||
christelmusic-nl-nginx: | ||
christelmusic-nl: | ||
build: | ||
dockerfile: Dockerfile-nginx | ||
restart: unless-stopped | ||
volumes: | ||
- ./app/public:/usr/share/nginx/html/:delegated | ||
ports: | ||
- '8081:80' | ||
|
||
christelmusic-nl-php: | ||
build: | ||
dockerfile: Dockerfile-php | ||
dockerfile: Dockerfile | ||
restart: unless-stopped | ||
env_file: | ||
- .env.local | ||
volumes: | ||
- ./app:/usr/src/christelmusic.nl/:delegated | ||
- ./app:/var/www/html:delegated | ||
ports: | ||
- '8081:80' | ||
|
||
composer-build: | ||
build: | ||
dockerfile: Dockerfile-php | ||
dockerfile: Dockerfile | ||
target: builder | ||
volumes: | ||
- ./app:/usr/src/build/:delegated | ||
- ./app:/var/www/html:delegated | ||
command: | ||
- /bin/sh | ||
- -c | ||
- | | ||
composer install | ||
/usr/src/build/scripts/christelmusic warmup | ||
/var/www/html/scripts/christelmusic warmup |