-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #251 from KagurazakaNyaa/master
Add docker support
- Loading branch information
Showing
9 changed files
with
148 additions
and
1 deletion.
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,33 @@ | ||
.git | ||
# Ignore data, log & temp directories | ||
action_logs/ | ||
!cache/ | ||
cache/** | ||
!cache/img | ||
cache/img/** | ||
!cache/img/signatures | ||
cache/img/signatures/** | ||
!cache/img/signatures/static | ||
!cache/img/signatures/static/* | ||
tmp/ | ||
|
||
# Ignore installation-related files | ||
install/lock | ||
|
||
# Ignore PHP-related files & directories | ||
vendor/ | ||
|
||
# Ignore app's instance configuration | ||
config/** | ||
!config/.gitkeep | ||
|
||
# Files temporarily removed from further tracking | ||
# (based on https://stackoverflow.com/a/11366713/951007) | ||
config.php | ||
includes/constants.php | ||
|
||
# Ignore JavaScript / Node.js -related files & directories | ||
node_modules/ | ||
|
||
docker/ | ||
.env |
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 |
---|---|---|
|
@@ -30,3 +30,6 @@ includes/constants.php | |
|
||
# Ignore JavaScript / Node.js -related files & directories | ||
node_modules/ | ||
|
||
docker/ | ||
.env |
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
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,49 @@ | ||
version: '3.8' | ||
services: | ||
nginx: | ||
build: | ||
context: . | ||
dockerfile: nginx.dockerfile | ||
image: uniengine/nginx | ||
restart: unless-stopped | ||
depends_on: | ||
- php | ||
ports: | ||
- ${WEB_PORT:-80}:80 | ||
volumes: | ||
- /etc/localtime:/etc/localtime:ro | ||
- ./docker/config.php:/var/www/html/config.php | ||
- ./docker/constants.php:/var/www/html/includes/constants.php | ||
- shared_tmp:/var/www/html/tmp | ||
- shared_cache:/var/www/html/cache | ||
|
||
php: | ||
build: | ||
context: . | ||
dockerfile: php.dockerfile | ||
image: uniengine/php | ||
restart: unless-stopped | ||
depends_on: | ||
- db | ||
volumes: | ||
- /etc/localtime:/etc/localtime:ro | ||
- ./docker/config.php:/var/www/html/config.php | ||
- ./docker/constants.php:/var/www/html/includes/constants.php | ||
- shared_tmp:/var/www/html/tmp | ||
- shared_cache:/var/www/html/cache | ||
|
||
db: | ||
image: mariadb:10 | ||
restart: unless-stopped | ||
command: | ||
- --sql-mode= | ||
environment: | ||
MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD:-uniengine} | ||
MARIADB_DATABASE: ${MARIADB_DATABASE:-uniengine} | ||
volumes: | ||
- /etc/localtime:/etc/localtime:ro | ||
- ./docker/data:/var/lib/mysql | ||
|
||
volumes: | ||
shared_tmp: | ||
shared_cache: |
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,3 @@ | ||
WEB_PORT=80 | ||
MARIADB_ROOT_PASSWORD=uniengine | ||
MARIADB_DATABASE=uniengine |
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
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,20 @@ | ||
server { | ||
listen 80; | ||
server_name _; | ||
|
||
access_log /var/log/nginx/host.access.log main; | ||
|
||
root /var/www/html; | ||
|
||
location / { | ||
try_files $uri /index.php$is_args$args; | ||
} | ||
|
||
location ~ \.php$ { | ||
root html; | ||
fastcgi_pass php:9000; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name; | ||
include fastcgi_params; | ||
} | ||
} |
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,11 @@ | ||
FROM composer:latest as base | ||
COPY . /var/www/html | ||
RUN chown -R www-data:www-data /var/www/html | ||
USER www-data | ||
WORKDIR /var/www/html | ||
RUN composer install --no-dev | ||
|
||
FROM nginx:stable | ||
COPY --from=base /var/www/html /var/www/html | ||
COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
WORKDIR /var/www/html |
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,13 @@ | ||
FROM composer:latest as base | ||
COPY . /var/www/html | ||
RUN chown -R www-data:www-data /var/www/html | ||
USER www-data | ||
WORKDIR /var/www/html | ||
RUN composer install --no-dev | ||
|
||
FROM php:7.3-fpm | ||
RUN apt-get update && apt-get install -y zip unzip libpng-dev libzip-dev && apt-get clean | ||
RUN docker-php-ext-configure gd && docker-php-ext-install gd mysqli zip | ||
COPY --from=base /var/www/html /var/www/html | ||
RUN chown -R www-data:www-data /var/www/html | ||
WORKDIR /var/www/html |