-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 02a6659
Showing
4 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
FROM php:8.1-fpm | ||
LABEL maintainer="Amri Karisma <amrikarisma@live.com>" | ||
|
||
# Set working directory | ||
WORKDIR /var/www | ||
|
||
# Add docker php ext repo | ||
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ | ||
|
||
# Install php extensions | ||
RUN chmod +x /usr/local/bin/install-php-extensions && sync && \ | ||
install-php-extensions mbstring pdo_mysql mysqli zip exif pcntl gd memcached bcmath | ||
|
||
|
||
# Install dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
build-essential \ | ||
libpng-dev \ | ||
libjpeg62-turbo-dev \ | ||
libfreetype6-dev \ | ||
locales \ | ||
nano \ | ||
zip \ | ||
jpegoptim optipng pngquant gifsicle \ | ||
unzip \ | ||
git \ | ||
curl \ | ||
lua-zlib-dev \ | ||
libmemcached-dev \ | ||
nginx \ | ||
mariadb-client \ | ||
supervisor \ | ||
ca-certificates \ | ||
gnupg | ||
RUN mkdir -p /etc/apt/keyrings | ||
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg | ||
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list | ||
|
||
RUN apt-get update && apt-get install -y nodejs | ||
|
||
# Install composer | ||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | ||
|
||
# Add user for laravel application | ||
RUN addgroup --gid 1000 www \ | ||
&& adduser \ | ||
--disabled-password \ | ||
--gecos "" \ | ||
--home "$(pwd)" \ | ||
--ingroup www \ | ||
--no-create-home \ | ||
--uid 1000 \ | ||
www | ||
|
||
# PHP Error Log Files | ||
RUN mkdir /var/log/php | ||
RUN touch /var/log/php/errors.log && chmod 777 /var/log/php/errors.log | ||
|
||
# Copy PHP and Nginx config | ||
COPY --chown=root:root php.ini /usr/local/etc/php/conf.d/app.ini | ||
COPY --chown=root:root nginx.conf /etc/nginx/sites-enabled/default | ||
|
||
# Install Node.js | ||
RUN npm install npm@latest -g | ||
|
||
# Clear cache | ||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
docker build -t kentos93/php_vestora:latest . && \ | ||
docker tag kentos93/php_vestora kentos93/php_vestora:$(date +%s) && \ | ||
docker push --all-tags kentos93/php_vestora && \ | ||
docker rmi -f $(docker images -q kentos93/php_vestora) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
server { | ||
listen 80; | ||
root /var/www/public; | ||
|
||
client_max_body_size 64M; | ||
|
||
add_header X-Frame-Options "SAMEORIGIN"; | ||
add_header X-Content-Type-Options "nosniff"; | ||
|
||
index index.php index.html; | ||
charset utf-8; | ||
|
||
location = /favicon.ico { | ||
access_log off; | ||
log_not_found off; | ||
} | ||
location = /robots.txt { | ||
access_log off; | ||
log_not_found off; | ||
} | ||
|
||
error_page 404 /index.php; | ||
|
||
location ~ \.php$ { | ||
try_files $uri =404; | ||
fastcgi_split_path_info ^(.+\.php)(/.+)$; | ||
fastcgi_pass 127.0.0.1:9000; | ||
fastcgi_index index.php; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_param PATH_INFO $fastcgi_path_info; | ||
fastcgi_buffering off; | ||
} | ||
|
||
location / { | ||
try_files $uri $uri/ /index.php?$query_string; | ||
gzip_static on; | ||
} | ||
|
||
location ~ /\.(?!well-known).* { | ||
deny all; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
log_errors=1 | ||
display_errors=1 | ||
post_max_size=64M | ||
upload_max_filesize=64M | ||
display_startup_errors=1 | ||
error_log=/var/log/php/errors.log |