Skip to content

Instantly share code, notes, and snippets.

@xuannghia
Created December 19, 2020 12:12
Show Gist options
  • Save xuannghia/63068912799927aa5bfe33ae6cb4f5a9 to your computer and use it in GitHub Desktop.
Save xuannghia/63068912799927aa5bfe33ae6cb4f5a9 to your computer and use it in GitHub Desktop.
file_uploads = On
memory_limit = 100M
upload_max_filesize = 100M
post_max_size = 50M
max_execution_time = 600
version: '3.2'
services:
laravel:
image: onecom
build:
context: .
ports:
- 9000:9000
environment:
DB_NAME: laravel_db
DB_HOST: mysql
DB_USER: user
DB_PASS: something
volumes:
- ./onecom_api:/var/www/html
- ./custom.php.ini:/usr/local/etc/php/conf.d/uploads.ini
mysql:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: laravel_db
MYSQL_USER: user
MYSQL_PASSWORD: something
MYSQL_ROOT_PASSWORD: root_password
volumes:
- ./db:/var/lib/mysql
webserver:
image: nginx:1.17-alpine
restart: unless-stopped
ports:
- "5956:80"
volumes:
- ./onecom_api:/var/www/html
- ./nginx.conf:/etc/nginx/conf.d/default.conf
FROM php:7.4-fpm-alpine
WORKDIR /var/www/html
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
COPY ./onecom_api /var/www/html
server {
listen 80;
index index.php index.html;
root /var/www/html/public;
client_max_body_size 32M;
location / {
try_files $uri /index.php?$args;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass laravel:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment