-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
52 lines (40 loc) · 1.78 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# syntax=docker/dockerfile:1.4
ARG PHP_VERSION=8.1
FROM php:${PHP_VERSION}-cli-alpine
# https://github.com/opencontainers/image-spec/blob/main/annotations.md
LABEL org.opencontainers.image.title="llaville/box-manifest"
LABEL org.opencontainers.image.description="Docker image of bartlett/box-manifest Composer package"
LABEL org.opencontainers.image.source="https://github.com/llaville/box-manifest"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.authors="llaville"
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh \
&& cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini
# Install Composer v2 binary version
COPY --from=composer/composer:2-bin /composer /usr/bin/composer
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_PREFER_STABLE 1
# Copy codebase
COPY bin /usr/src/box-manifest/bin
COPY src /usr/src/box-manifest/src
COPY resources /usr/src/box-manifest/resources
COPY autoload_phar_runtime.template /usr/src/box-manifest/autoload_phar_runtime.template
COPY composer.json /usr/src/box-manifest/composer.json
COPY composer.lock /usr/src/box-manifest/composer.lock
# Install dependencies
RUN apk add --no-cache --update git bash \
&& composer install \
--working-dir=/usr/src/box-manifest \
--prefer-dist \
--no-scripts \
--no-dev \
--no-progress \
--no-interaction \
&& ln -sfv /usr/src/box-manifest/bin/box-manifest /usr/local/bin/box-manifest
# Create a group and user
RUN addgroup appgroup && adduser appuser -D -G appgroup
# Tell docker that all future commands should run as the appuser user
USER appuser
# Following recommendation at https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#workdir
ENV BOX_REQUIREMENT_CHECKER=0
ENTRYPOINT ["/entrypoint.sh"]