-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
75 lines (37 loc) · 1.32 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
FROM php:8.1-cli-alpine AS composer_base
WORKDIR /var/www/html
COPY --from=composer /usr/bin/composer /usr/bin/composer
FROM node:19-alpine AS vite_base
WORKDIR /var/www/html
FROM php:8.1-fpm-alpine AS php_base
WORKDIR /var/www/html
RUN docker-php-ext-install pdo pdo_mysql
RUN docker-php-ext-install opcache
COPY docker/php/opcache.ini /usr/local/etc/php/conf.d/opcache.ini
FROM nginx:alpine AS nginx
WORKDIR /var/www/html
COPY docker/nginx/default.conf /etc/nginx/conf.d
COPY build/nginx/ /var/www/html/
FROM php_base AS fpm
WORKDIR /var/www/html
COPY docker/php/entrypoint.sh /var/www/entrypoint.sh
RUN chmod +x /var/www/entrypoint.sh
COPY build/php/ /var/www/html/
RUN chown -R www-data:www-data /var/www/html/storage
RUN chown -R www-data:www-data /var/www/html/bootstrap/cache
ENV APP_ENV=production
ENV APP_DEBUG=false
VOLUME /var/www/html/storage/app/jobs
CMD ["/var/www/entrypoint.sh"]
FROM php_base AS cron
WORKDIR /var/www/html
COPY docker/php/entrypoint.sh /var/www/entrypoint.sh
RUN chmod +x /var/www/entrypoint.sh
COPY build/php/ /var/www/html/
COPY docker/php/crontab /etc/crontabs/root
RUN chown -R www-data:www-data /var/www/html/storage
RUN chown -R www-data:www-data /var/www/html/bootstrap/cache
ENV APP_ENV=production
ENV APP_DEBUG=false
VOLUME /var/www/html/storage/app/jobs
CMD ["crond", "-f"]