setup hosting
This commit is contained in:
parent
01c985e0f6
commit
0af12ff021
|
|
@ -0,0 +1,32 @@
|
|||
FROM php:8.2-fpm
|
||||
|
||||
WORKDIR /var/www
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
git \
|
||||
curl \
|
||||
libpng-dev \
|
||||
libonig-dev \
|
||||
libxml2-dev \
|
||||
zip \
|
||||
unzip \
|
||||
libzip-dev \
|
||||
libicu-dev \
|
||||
libjpeg62-turbo-dev \
|
||||
libfreetype6-dev \
|
||||
gnupg \
|
||||
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
|
||||
&& apt-get install -y nodejs \
|
||||
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||
&& docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip intl
|
||||
|
||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||
|
||||
COPY . /var/www
|
||||
|
||||
RUN chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache
|
||||
|
||||
EXPOSE 9000
|
||||
CMD ["php-fpm"]
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
version: '3'
|
||||
|
||||
services:
|
||||
sarakata_php:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: sarakata-app
|
||||
container_name: sarakata-php-container
|
||||
restart: unless-stopped
|
||||
working_dir: /var/www
|
||||
volumes:
|
||||
- .:/var/www
|
||||
networks:
|
||||
- sarakata-network
|
||||
- laravel-network
|
||||
|
||||
sarakata_nginx:
|
||||
image: nginx:alpine
|
||||
container_name: sarakata-nginx-container
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8091:80"
|
||||
volumes:
|
||||
- .:/var/www
|
||||
- ./nginx/conf.d:/etc/nginx/conf.d
|
||||
networks:
|
||||
- sarakata-network
|
||||
depends_on:
|
||||
- sarakata_php
|
||||
|
||||
networks:
|
||||
sarakata-network:
|
||||
driver: bridge
|
||||
|
||||
laravel-network:
|
||||
external: true
|
||||
name: bpbd_laravel-network
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
server {
|
||||
listen 80;
|
||||
server_name sarakata.hakimlutfi.my.id;
|
||||
|
||||
root /var/www/public;
|
||||
index index.php index.html;
|
||||
|
||||
access_log /var/log/nginx/sarakata_access.log;
|
||||
error_log /var/log/nginx/sarakata_error.log;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass sarakata_php:9000;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue