-
Notifications
You must be signed in to change notification settings - Fork 1
/
coolify.Dockerfile
70 lines (52 loc) · 1.63 KB
/
coolify.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
ARG NODE_VERSION=20.9.0
ARG PHP_VERSION=8.2
FROM serversideup/php:${PHP_VERSION}-fpm-nginx as base
WORKDIR /var/www/html
RUN PHP_OPCACHE_ENABLE=1
COPY composer.json composer.lock ./
RUN composer install --ignore-platform-reqs --no-dev --no-interaction --no-plugins --no-scripts --prefer-dist
FROM node:${NODE_VERSION}-alpine as asset-files
RUN apk add --no-cache gcompat
WORKDIR /app
COPY . .
COPY --from=base --chown=9999:9999 /var/www/html .
RUN yarn install && yarn && yarn build
FROM base as runner
ARG user
ARG uid
ARG TZ
WORKDIR /var/www/html
USER root
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
cron \
default-mysql-client \
vim
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/* && \
# Install PHP extensions
docker-php-ext-install pdo_mysql mbstring calendar exif pcntl bcmath gd && \
#install mailparse
pecl install mailparse && \
echo extension=mailparse.so > /usr/local/etc/php/conf.d/mailparse.ini
# Get latest Composer
COPY --from=base --chown=9999:9999 /var/www/html .
COPY --chown=9999:9999 . .
RUN composer update --ignore-platform-reqs
RUN composer dump-autoload
RUN chown -R www-data:www-data .
COPY --from=asset-files --chown=www-data:www-data /app/public/build ./public/build
RUN chown -R www-data:www-data /var/www
# RUN php artisan route:cache
# RUN php artisan view:cache
RUN echo "alias ll='ls -al'" >>/etc/bash.bashrc
RUN echo "alias a='php artisan'" >>/etc/bash.bashrc
RUN echo "alias logs='tail -f storage/logs/laravel.log'" >>/etc/bash.bashrc
USER www-data