forked from Paymenter/Paymenter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (44 loc) · 2.13 KB
/
Dockerfile
File metadata and controls
56 lines (44 loc) · 2.13 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
# Stage 1:
# Build the actual container with all of the needed PHP dependencies that will run the application.
FROM --platform=$TARGETOS/$TARGETARCH php:8.3-fpm-alpine AS final
WORKDIR /app
RUN apk add --no-cache --update ca-certificates dcron curl git supervisor tar unzip nginx libpng-dev libxml2-dev libzip-dev icu-dev autoconf make g++ gcc libc-dev linux-headers gmp-dev \
&& docker-php-ext-configure zip \
&& docker-php-ext-install bcmath gd pdo_mysql zip intl sockets gmp \
&& pecl install redis \
&& docker-php-ext-enable redis \
&& apk del autoconf make g++ gcc libc-dev
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
COPY composer.json composer.lock ./
RUN composer install --no-dev --no-autoloader --no-scripts
COPY . ./
RUN composer install --no-dev --optimize-autoloader
RUN cp .env.example .env \
&& chmod 777 -R bootstrap storage/* \
&& rm -rf .env bootstrap/cache/*.php \
&& chown -R nginx:nginx . \
&& rm /usr/local/etc/php-fpm.conf \
&& echo "* * * * * /usr/local/bin/php /app/artisan schedule:run >> /dev/null 2>&1" >> /var/spool/cron/crontabs/root \
&& mkdir -p /var/run/php /var/run/nginx
FROM --platform=$TARGETOS/$TARGETARCH node:22-alpine AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY . ./
COPY --from=final /app/vendor /app/vendor
RUN npm run build
# Switch back to the final stage
FROM final AS production
COPY --from=build /app/public /app/public
# Copy themes and extensions to default locations for renewal on startup
RUN cp -r /app/themes /app/themes_default && \
cp -r /app/extensions /app/extensions_default
# Environment variable to skip default themes/extensions renewal
# Set PAYMENTER_SKIP_DEFAULT=true to keep any custom modifications to defaults
ENV PAYMENTER_SKIP_DEFAULT=false
COPY .github/docker/default.conf /etc/nginx/http.d/default.conf
COPY .github/docker/www.conf /usr/local/etc/php-fpm.conf
COPY .github/docker/supervisord.conf /etc/supervisord.conf
EXPOSE 80
ENTRYPOINT [ "/bin/ash", ".github/docker/entrypoint.sh" ]
CMD [ "supervisord", "-n", "-c", "/etc/supervisord.conf" ]