-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
61 lines (49 loc) · 1.61 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
53
54
55
56
57
58
59
60
61
FROM alpine:3.16
RUN apk update && apk add --no-cache \
php81 \
php81-common \
php81-fpm \
php81-pdo \
php81-opcache \
php81-gd \
php81-zip \
php81-phar \
php81-iconv \
php81-cli \
php81-curl \
php81-openssl \
php81-mbstring \
php81-tokenizer \
php81-fileinfo \
php81-json \
php81-xml \
php81-xmlwriter \
php81-simplexml \
php81-dom \
php81-pdo_mysql \
php81-pdo_sqlite \
php81-tokenizer \
php81-pecl-redis \
php81-pcntl \
php81-posix
RUN ln -sf /usr/bin/php81 /usr/bin/php
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
RUN php composer-setup.php
RUN php -r "unlink('composer-setup.php');"
RUN mv composer.phar /usr/local/bin/composer
ARG userid=1000
ARG groupid=1000
RUN apk add curl nano supervisor
RUN mkdir -p /etc/supervisor.d/
COPY .docker/config/php8.1/php.ini-development /etc/php81/php.ini
COPY .docker/config/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
COPY .docker/config/supervisor/supervisor.d/ /etc/supervisor.d/
RUN echo "* * * * * php /app/artisan schedule:run >> /dev/null 2>&1" >> /etc/crontabs/appuser
WORKDIR /app
COPY . .
RUN addgroup -g $userid appgroup
RUN adduser -D -u $groupid appuser -G appgroup
RUN chown -R appuser:appgroup /app
#USER appuser
CMD supervisord -n -c /etc/supervisord.conf