forked from buku-masjid/buku-masjid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (33 loc) · 1.02 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
# ================
# Base Stage
# ================
FROM serversideup/php:8.1-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
USER root:root
RUN apt-get update && \
apt-get install -y libpng-dev && \
docker-php-ext-install pdo_mysql gd && \
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
COPY .env.example .env.tmp
RUN sed 's/DB_HOST=127.0.0.1/DB_HOST=mysql_host/' .env.tmp > .env && rm .env.tmp
# 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