-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
106 lines (74 loc) · 2.61 KB
/
Dockerfile
File metadata and controls
106 lines (74 loc) · 2.61 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
FROM alpine:3.20 AS jsmin
RUN apk add --no-cache \
git \
gcc \
libc-dev
RUN git clone https://github.com/douglascrockford/JSMin /tmp/jsmin && \
gcc /tmp/jsmin/jsmin.c -o /usr/bin/jsmin && \
rm -rf /tmp/jsmin
FROM php:8.3-fpm-alpine AS development
# add other deps for dev here
RUN apk add --no-cache \
libzip-dev \
bash
COPY --from=composer:2.8 /usr/bin/composer /usr/bin/composer
COPY --from=jsmin /usr/bin/jsmin /usr/bin/jsmin
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
WORKDIR /opt/findingaid
COPY ./composer.json .
COPY ./composer.lock .
RUN composer install --no-interaction
COPY /exe ./exe
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
EXPOSE 9000
CMD ["php-fpm", "-F"]
FROM php:8.3-fpm-alpine AS prod-builder
RUN apk add --no-cache bash
COPY --from=composer:2.8 /usr/bin/composer /usr/bin/composer
COPY --from=jsmin /usr/bin/jsmin /usr/bin/jsmin
WORKDIR /composer
COPY ./composer.json .
COPY ./composer.lock .
RUN composer install --no-interaction --no-dev
FROM php:8.3-fpm-alpine AS ci
RUN apk add --no-cache \
libzip-dev \
bash
WORKDIR /app
COPY --from=jsmin /usr/bin/jsmin /usr/bin/jsmin
COPY --from=development /opt/findingaid/vendor /opt/findingaid/vendor
COPY ./phpunit.xml /opt/findingaid/phpunit.xml
COPY /app .
COPY exe/build.sh /opt/findingaid/exe/build.sh
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
EXPOSE 9000
CMD ["php-fpm", "-F"]
FROM php:8.3-fpm-alpine AS production
RUN apk add --no-cache \
libzip-dev \
bash \
jq \
curl
COPY --from=jsmin /usr/bin/jsmin /usr/bin/jsmin
COPY --from=prod-builder /composer/vendor /opt/findingaid/vendor
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
WORKDIR /opt/findingaid
COPY ./app ./app
COPY ./public ./public
COPY ./exe ./exe
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
RUN ./exe/build.sh
RUN chmod +x /opt/findingaid/exe/findingaid-cache-regen/fa-regen \
/opt/findingaid/exe/findingaid-cache-regen/fa-full-regen \
/opt/findingaid/exe/findingaid-cache-regen/fetch-ead-arks && \
ln -s /opt/findingaid/exe/findingaid-cache-regen/fa-regen /usr/local/bin/fa-regen && \
ln -s /opt/findingaid/exe/findingaid-cache-regen/fa-full-regen /usr/local/bin/fa-full-regen && \
ln -s /opt/findingaid/exe/findingaid-cache-regen/fetch-ead-arks /usr/local/bin/fetch-ead-arks
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
EXPOSE 9000
CMD ["php-fpm", "-F"]