-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (33 loc) · 1.04 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
FROM php:8.3-cli
MAINTAINER Christoph Kappestein <[email protected]>
LABEL description="TypeSchema Code Generator"
ENV FORMAT ""
ENV NAMESPACE ""
ENV SOURCE "typeschema.json"
ENV COMPOSER_VERSION "2.5.5"
ENV COMPOSER_SHA256 "566a6d1cf4be1cc3ac882d2a2a13817ffae54e60f5aa7c9137434810a5809ffc"
# install default packages
RUN apt-get update && apt-get -y install \
wget \
git \
libcurl3-dev \
libzip-dev \
libonig-dev
# install php extensions
RUN docker-php-ext-install \
bcmath \
curl \
zip \
mbstring
# install composer
RUN wget -O /usr/bin/composer https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar
RUN echo "${COMPOSER_SHA256} */usr/bin/composer" | sha256sum -c -
RUN chmod +x /usr/bin/composer
VOLUME /usr/src/typeschema/output
COPY . /usr/src/typeschema
WORKDIR /usr/src/typeschema
RUN chmod +x /usr/src/typeschema/bin/generator
# run composer
RUN composer install
# run generation
CMD php bin/generator schema:parse "output/$SOURCE" output --format="$FORMAT" --config="namespace=$NAMESPACE"