-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
29 lines (23 loc) · 948 Bytes
/
Dockerfile
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
FROM composer/composer:2.8-bin AS composer
LABEL maintainer="Elias Häußler <[email protected]>"
FROM php:8.3-alpine
COPY --from=composer /composer /usr/bin/composer
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV PROJECT_BUILDER_EXECUTOR=docker
ADD . /project-builder
WORKDIR /project-builder
# Install Git and php-zip extension
RUN apk update \
&& apk add git libzip-dev zip \
&& docker-php-ext-install zip
# Build project-builder artifact for later use in entrypoint
ARG PROJECT_BUILDER_VERSION=0.0.0
RUN composer config version "$PROJECT_BUILDER_VERSION" \
&& composer update --prefer-dist --no-dev --no-install --ignore-platform-req=ext-sockets \
&& git add -f composer.lock \
&& mkdir artifacts \
&& git stash \
&& git archive --format=tar --output="artifacts/project-builder-$PROJECT_BUILDER_VERSION.tar" "stash@{0}" \
&& git stash pop
WORKDIR /app
ENTRYPOINT ["/project-builder/docker-entrypoint.sh"]