-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (36 loc) · 1.38 KB
/
Copy pathDockerfile
File metadata and controls
47 lines (36 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM php:8.0-alpine3.13 AS build-env
LABEL owner="Giancarlos Salas"
LABEL maintainer="giansalex@gmail.com"
ENV APP_ENV prod
WORKDIR /app
RUN apk update && apk add --no-cache \
openssl \
git \
unzip && \
curl --silent --show-error -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
COPY . .
RUN git apply docker/drift-kernel.patch
RUN git apply docker/drift-adapter.patch
RUN composer install --no-interaction --no-dev --optimize-autoloader --ignore-platform-reqs && \
composer require drift/server:0.1.25 --ignore-platform-reqs && \
composer require react/filesystem:^0.1.2 --ignore-platform-reqs && \
composer dump-autoload --optimize --no-dev --classmap-authoritative && \
composer dump-env prod --empty && \
find -name "[Tt]est*" -type d -exec rm -rf {} + && \
find -type f -name '*.md' -delete;
FROM php:8.0-alpine3.13
ENV APP_ENV=prod
ENV API_TOKEN=abcxyz
ENV TRUSTED_PROXIES="127.0.0.1,REMOTE_ADDR"
EXPOSE 8080
WORKDIR /var/www/html
RUN apk update && \
docker-php-ext-configure opcache --enable-opcache && \
docker-php-ext-install opcache && \
docker-php-ext-install pcntl
COPY --from=build-env /app .
# Copy configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY docker/config $PHP_INI_DIR/conf.d/
COPY docker/docker-entrypoint.sh .
CMD ["sh", "./docker-entrypoint.sh"]