forked from buku-masjid/buku-masjid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (31 loc) · 967 Bytes
/
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
ARG PHP_VERSION='8.1'
# ================
# Base Stage
# ================
FROM serversideup/php:${PHP_VERSION}-fpm-nginx as base
ENV AUTORUN_ENABLED=false
ENV SSL_MODE=off
# ================
# Production Stage
# ================
FROM base as production
ENV APP_ENV=production
ENV APP_DEBUG=false
# Required Modules
RUN apt-get update && \
apt-get install -y php${PHP_VERSION}-mysql php${PHP_VERSION}-gd libpng-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
USER $PUID:$PGID
# Copy contents.
# - To ignore files or folders, use .dockerignore
COPY --chown=$PUID:$PGID . .
RUN composer install --optimize-autoloader --no-dev --no-interaction --no-progress --ansi
# artisan commands
RUN php ./artisan key:generate && \
php ./artisan passport:keys && \
php ./artisan view:cache && \
php ./artisan route:cache && \
php ./artisan config:cache && \
php ./artisan storage:link
USER root:root