-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for
Dockerfile
instructions
- Loading branch information
Showing
3 changed files
with
62 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM php:8.1-cli | ||
|
||
WORKDIR /app/ | ||
COPY public/ public/ | ||
COPY vendor/ vendor/ | ||
|
||
ENV X_LISTEN 0.0.0.0:8080 | ||
EXPOSE 8080 | ||
|
||
ENTRYPOINT php public/index.php |
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,29 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM composer:2 AS build | ||
|
||
WORKDIR /app/ | ||
COPY composer.json composer.lock ./ | ||
# production environment should install optimized dependencies: | ||
# RUN composer install --no-dev --ignore-platform-reqs --optimize-autoloader | ||
# dev environment already has dependencies installed: | ||
COPY vendor/ vendor/ | ||
|
||
FROM php:8.1-alpine | ||
|
||
# recommended: install optional extensions ext-ev and ext-sockets | ||
RUN apk --no-cache add ${PHPIZE_DEPS} libev \ | ||
&& pecl install ev \ | ||
&& docker-php-ext-enable ev \ | ||
&& docker-php-ext-install sockets \ | ||
&& apk del ${PHPIZE_DEPS} | ||
|
||
WORKDIR /app/ | ||
COPY public/ public/ | ||
# COPY src/ src/ | ||
COPY --from=build /app/vendor/ vendor/ | ||
|
||
ENV X_LISTEN 0.0.0.0:8080 | ||
EXPOSE 8080 | ||
|
||
USER nobody:nobody | ||
ENTRYPOINT php public/index.php |