Added docker, nginx and systemd configs

This commit is contained in:
ftc
2022-12-11 18:53:19 +03:00
commit 8d4f7690fc
5 changed files with 90 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
version: '2'
services:
nginx:
build: ./nginx
ports:
- '8888:80'
volumes:
- ./../app:/var/www
app:
build: web
volumes:
- ./../app:/var/www
db:
image: mariadb
restart: always
environment:
- MYSQL_ROOT_PASSWORD=rootpass
volumes:
- ./../data:/var/lib/mysql
+17
View File
@@ -0,0 +1,17 @@
[Unit]
Description=glade_site
Requires=docker.service
After=docker.service
[Service]
Restart=always
User=root
Group=docker
WorkingDirectory=/mnt/storage/glade/glade_docker
# Shutdown container (if running) when unit is started
ExecStartPre=/usr/bin/docker compose -f docker-compose.yml down
# Start container when unit is started
ExecStart=/usr/bin/docker compose -f docker-compose.yml up
# Stop container when unit is stopped
ExecStop=/usr/bin/docker compose -f docker-compose.yml down
[Install]
WantedBy=multi-user.target
+3
View File
@@ -0,0 +1,3 @@
FROM nginx
RUN mkdir -p /var/www
COPY glade.conf /etc/nginx/conf.d/default.conf
+44
View File
@@ -0,0 +1,44 @@
server {
listen *:80;
# listen 91.109.206.118:443 ssl;
client_max_body_size 512m;
keepalive_timeout 70;
large_client_header_buffers 8 16k;
access_log /var/log/glade.access.log main;
error_log /var/log/glade.error.log;
server_name glade.1sim.online;
set $root /var/www;
location = /favicon.ico {
root $root;
try_files $uri $uri/ =404;
}
location ~ \.php$ {
#include closed.conf;
root $root;
try_files $uri $uri/ =404;
fastcgi_pass app:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $root$fastcgi_script_name;
include fastcgi_params;
}
location / {
root $root;
index index.html index.htm index.php index.shtml;
}
location ~ /\.ht {
deny all;
}
}
server {
listen *:80;
server_name glade.acm.petrsu.ru glade.1sim.ru;
return 301 $scheme://glade.1sim.online$request_uri;
}
+5
View File
@@ -0,0 +1,5 @@
FROM php:7.4-fpm
RUN apt-get update
RUN apt-get install -y zip libxml2-dev libpng-dev libonig-dev
RUN docker-php-ext-install mysqli simplexml mbstring gd
RUN chown -R www-data:www-data /var/www