-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (39 loc) · 1.19 KB
/
Dockerfile
File metadata and controls
55 lines (39 loc) · 1.19 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
FROM composer:2.8 AS composer
ARG TESTING=false
ENV TESTING=$TESTING
WORKDIR /usr/local/src/
COPY composer.lock /usr/local/src/
COPY composer.json /usr/local/src/
RUN composer update \
--ignore-platform-reqs \
--optimize-autoloader \
--no-plugins \
--no-scripts \
--prefer-dist
FROM php:8.4-cli-alpine AS compile
RUN apk add --no-cache \
git \
autoconf \
make \
g++ \
libsodium-dev
# Build scrypt extension
FROM compile AS scrypt
RUN pecl install scrypt
FROM compile AS final
LABEL maintainer="team@appwrite.io"
WORKDIR /usr/src/code
# Enable hash extension (built-in)
# Install and enable sodium extension
RUN docker-php-ext-install sodium
# Copy and enable scrypt extension
COPY --from=scrypt /usr/local/lib/php/extensions/no-debug-non-zts-20240924/scrypt.so /usr/local/lib/php/extensions/no-debug-non-zts-20240924/scrypt.so
RUN docker-php-ext-enable scrypt
# Configure PHP
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
&& echo "memory_limit=256M" >> $PHP_INI_DIR/php.ini
# Copy composer dependencies
COPY --from=composer /usr/local/src/vendor /usr/src/code/vendor
# Add Source Code
COPY . /usr/src/code
CMD [ "tail", "-f", "/dev/null" ]