From 93de0bea4901577d8616e54f7fe58856a113db29 Mon Sep 17 00:00:00 2001 From: Robin Date: Sat, 18 Jul 2020 12:05:34 +0200 Subject: [PATCH 01/17] Prevent access to template/cache https://github.com/NamelessMC/Nameless/commit/9bd1433f0e18b9de5472480505e9d216ecbc0d1e --- nginx_web/nginx.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nginx_web/nginx.conf b/nginx_web/nginx.conf index b708da8..d2809b1 100644 --- a/nginx_web/nginx.conf +++ b/nginx_web/nginx.conf @@ -31,6 +31,10 @@ http { try_files $uri $uri/ /index.php?$args; } + location ~ \.(tpl|cache)$ { + return 403; + } + location = /robots.txt { allow all; log_not_found off; From bd7c6aef848b003e78ea15a8298b30c9b969de0f Mon Sep 17 00:00:00 2001 From: Derkades Date: Mon, 27 Jul 2020 18:33:21 +0200 Subject: [PATCH 02/17] Compose file for development --- docker-compose.dev.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 docker-compose.dev.yml diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 0000000..781ef69 --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,25 @@ +version: '2' + +services: + + namelessmc: + build: nginx_web + ports: ['80:80'] + volumes: ['/srv/namelessmc/web:/data'] # same as php container + depends_on: [namelessmc_php] + restart: unless-stopped + + namelessmc_php: + build: php_fpm + volumes: ['/srv/namelessmc/web:/data'] # same as web container + restart: unless-stopped + + namelessmc_db: + image: mariadb + volumes: ['/srv/namelessmc/db:/var/lib/mysql'] + environment: + MYSQL_ROOT_PASSWORD: nameless + MYSQL_USER: nameless + MYSQL_PASSWORD: nameless + MYSQL_DATABASE: nameless + restart: unless-stopped From c154235d46fd0e8b8e07e4136a54685cbae04e2d Mon Sep 17 00:00:00 2001 From: Birkhoff Lee Date: Tue, 28 Jul 2020 01:45:57 +0800 Subject: [PATCH 03/17] Remove default restart policy --- docker-compose.dev.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 781ef69..01f6a6e 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -7,12 +7,10 @@ services: ports: ['80:80'] volumes: ['/srv/namelessmc/web:/data'] # same as php container depends_on: [namelessmc_php] - restart: unless-stopped namelessmc_php: build: php_fpm volumes: ['/srv/namelessmc/web:/data'] # same as web container - restart: unless-stopped namelessmc_db: image: mariadb @@ -22,4 +20,3 @@ services: MYSQL_USER: nameless MYSQL_PASSWORD: nameless MYSQL_DATABASE: nameless - restart: unless-stopped From 817722820858b3dc61de171b42beac2662321d43 Mon Sep 17 00:00:00 2001 From: Birkhoff Lee Date: Tue, 28 Jul 2020 01:46:34 +0800 Subject: [PATCH 04/17] Update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 2d0fc88..7935fda 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Derkades +Copyright (c) 2020 NamelessMC Docker Image Maintainers (https://github.com/NamelessMC/Nameless-Docker/graphs/contributors) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 10c774c7d5253d48c131a8ea9acdc2357d49bfa1 Mon Sep 17 00:00:00 2001 From: Birkhoff Lee Date: Tue, 28 Jul 2020 01:47:36 +0800 Subject: [PATCH 05/17] Update image build tag --- build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 2bdd402..20e46c1 100755 --- a/build.sh +++ b/build.sh @@ -1,3 +1,3 @@ #!/bin/sh -docker build -t derkades/namelessmc-nginx nginx_web -docker build -t derkades/namelessmc-php php_fpm +docker build -t namelessmc-nginx nginx_web +docker build -t namelessmc-php php_fpm From 466f8e2b239538cf1ca4162d72bc5db72794ecd5 Mon Sep 17 00:00:00 2001 From: Birkhoff Lee Date: Tue, 28 Jul 2020 01:48:03 +0800 Subject: [PATCH 06/17] Update image build tag --- deploy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy.sh b/deploy.sh index c0d14e2..ee964dd 100755 --- a/deploy.sh +++ b/deploy.sh @@ -6,6 +6,6 @@ set +e docker buildx rm namelessmc_builder set -e docker buildx create --use --name namelessmc_builder -docker buildx build -t derkades/namelessmc-nginx --platform=linux/arm,linux/arm64,linux/amd64 nginx_web --push -docker buildx build -t derkades/namelessmc-php --platform=linux/arm,linux/arm64,linux/amd64 php_fpm --push +docker buildx build -t namelessmc-nginx --platform=linux/arm,linux/arm64,linux/amd64 nginx_web --push +docker buildx build -t namelessmc-php --platform=linux/arm,linux/arm64,linux/amd64 php_fpm --push docker buildx rm namelessmc_builder From 21d08743165a24abf3d831b8567f71d157c6e783 Mon Sep 17 00:00:00 2001 From: Birkhoff Lee Date: Tue, 28 Jul 2020 01:55:03 +0800 Subject: [PATCH 07/17] Update Docker Hub image and container names --- docker-compose.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 03f976b..a0c530a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,21 +2,21 @@ version: '2' services: - namelessmc: - image: derkades/namelessmc-nginx + nginx: + image: namelessmc/nameless-nginx ports: ['80:80'] volumes: ['/srv/namelessmc/web:/data'] # same as php container # environment: - # PHP_FPM: namelessmc_php:9000 - depends_on: [namelessmc_php] + # PHP_FPM: php:9000 + depends_on: [php] restart: unless-stopped - namelessmc_php: - image: derkades/namelessmc-php + php: + image: namelessmc/nameless-php volumes: ['/srv/namelessmc/web:/data'] # same as web container restart: unless-stopped - namelessmc_db: + db: image: mariadb volumes: ['/srv/namelessmc/db:/var/lib/mysql'] environment: From 1555d435f7bc89d87ac8cdb8be989b6679e62ec9 Mon Sep 17 00:00:00 2001 From: Birkhoff Lee Date: Tue, 28 Jul 2020 02:05:27 +0800 Subject: [PATCH 08/17] Update deployment guide --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b62bbfb..5e4a2be 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,17 @@ You have to manually install Docker first if you don't have it installed on your You will need to install [Docker Compose](https://docs.docker.com/compose/) for automated deploying. -```bash -sudo apt install docker-compose +```shell +$ apt install docker-compose # debian ``` -Download the example file, optionally change the directories, passwords, etc. then run it with +Download the example file, optionally change the directories, passwords, etc. then run it -```bash -docker-compose up -d +```shell +$ git clone https://github.com/NamelessMC/Nameless-Docker.git +$ cd Nameless-Docker +$ vim docker-compose.dev.yaml +$ docker-compose up -d ``` When the containers are up, visit the website in a browser to start the installer. By default it listens on any interface, port 80. From 4499daf35cd4d6aebaf84b8077029ac63f9e98b6 Mon Sep 17 00:00:00 2001 From: Birkhoff Lee Date: Tue, 28 Jul 2020 02:06:28 +0800 Subject: [PATCH 09/17] Update database address for deployment guide --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e4a2be..12940ac 100644 --- a/README.md +++ b/README.md @@ -27,4 +27,4 @@ $ docker-compose up -d When the containers are up, visit the website in a browser to start the installer. By default it listens on any interface, port 80. -When the database configuration page shows up, fill in `namelessmc_db` for the *database address*. For database username, password and database name, fill `nameless` for all of them, if you used default database credentials. +When the database configuration page shows up, fill in `db` for the *database address*. For database username, password and database name, fill `nameless` for all of them, if you used default database credentials. From cda455abfd5aa72c32881cb440ba16bd2176c865 Mon Sep 17 00:00:00 2001 From: Derkades Date: Mon, 27 Jul 2020 20:31:13 +0200 Subject: [PATCH 10/17] Remove build.sh For testing the image, people can use the dev docker compose file --- build.sh | 3 --- 1 file changed, 3 deletions(-) delete mode 100755 build.sh diff --git a/build.sh b/build.sh deleted file mode 100755 index 20e46c1..0000000 --- a/build.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -docker build -t namelessmc-nginx nginx_web -docker build -t namelessmc-php php_fpm From e98397aa944707d58e1ffa09feb5c4a9644cda6f Mon Sep 17 00:00:00 2001 From: Derkades Date: Mon, 27 Jul 2020 20:32:18 +0200 Subject: [PATCH 11/17] Update service names in dev file as well --- docker-compose.dev.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 01f6a6e..d0bd0f3 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -2,17 +2,17 @@ version: '2' services: - namelessmc: + nginx: build: nginx_web ports: ['80:80'] volumes: ['/srv/namelessmc/web:/data'] # same as php container depends_on: [namelessmc_php] - namelessmc_php: + php: build: php_fpm volumes: ['/srv/namelessmc/web:/data'] # same as web container - namelessmc_db: + db: image: mariadb volumes: ['/srv/namelessmc/db:/var/lib/mysql'] environment: From f597f4e3050a5c8abf6dc328092a2ab01a290307 Mon Sep 17 00:00:00 2001 From: Derkades Date: Mon, 27 Jul 2020 20:32:42 +0200 Subject: [PATCH 12/17] Update default php fpm host --- nginx_web/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx_web/Dockerfile b/nginx_web/Dockerfile index 2eb66a3..fca72df 100644 --- a/nginx_web/Dockerfile +++ b/nginx_web/Dockerfile @@ -1,6 +1,6 @@ FROM nginx:alpine -ENV PHP_FPM="namelessmc_php:9000" +ENV PHP_FPM="php:9000" RUN deluser xfs && \ delgroup www-data && \ From 3fce6b2fb5a6f7e8b2620f858f8510760cfe73cc Mon Sep 17 00:00:00 2001 From: Derkades Date: Mon, 27 Jul 2020 20:35:27 +0200 Subject: [PATCH 13/17] Fix image repo name in deploy script --- deploy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy.sh b/deploy.sh index ee964dd..3e0fe44 100755 --- a/deploy.sh +++ b/deploy.sh @@ -6,6 +6,6 @@ set +e docker buildx rm namelessmc_builder set -e docker buildx create --use --name namelessmc_builder -docker buildx build -t namelessmc-nginx --platform=linux/arm,linux/arm64,linux/amd64 nginx_web --push -docker buildx build -t namelessmc-php --platform=linux/arm,linux/arm64,linux/amd64 php_fpm --push +docker buildx build -t namelessmc/namelessmc-nginx --platform=linux/arm,linux/arm64,linux/amd64 nginx_web --push +docker buildx build -t namelessmc/namelessmc-php --platform=linux/arm,linux/arm64,linux/amd64 php_fpm --push docker buildx rm namelessmc_builder From 2b48d23abcfe45bc4e799b6c95c14ef03a490ad7 Mon Sep 17 00:00:00 2001 From: Derkades Date: Tue, 28 Jul 2020 19:03:40 +0200 Subject: [PATCH 14/17] Shorter image names --- deploy.sh | 4 ++-- docker-compose.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy.sh b/deploy.sh index 3e0fe44..2023050 100755 --- a/deploy.sh +++ b/deploy.sh @@ -6,6 +6,6 @@ set +e docker buildx rm namelessmc_builder set -e docker buildx create --use --name namelessmc_builder -docker buildx build -t namelessmc/namelessmc-nginx --platform=linux/arm,linux/arm64,linux/amd64 nginx_web --push -docker buildx build -t namelessmc/namelessmc-php --platform=linux/arm,linux/arm64,linux/amd64 php_fpm --push +docker buildx build -t namelessmc/nginx --platform=linux/arm,linux/arm64,linux/amd64 nginx_web --push +docker buildx build -t namelessmc/php --platform=linux/arm,linux/arm64,linux/amd64 php_fpm --push docker buildx rm namelessmc_builder diff --git a/docker-compose.yml b/docker-compose.yml index a0c530a..e3eb4b2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '2' services: nginx: - image: namelessmc/nameless-nginx + image: namelessmc/nginx ports: ['80:80'] volumes: ['/srv/namelessmc/web:/data'] # same as php container # environment: @@ -12,7 +12,7 @@ services: restart: unless-stopped php: - image: namelessmc/nameless-php + image: namelessmc/php volumes: ['/srv/namelessmc/web:/data'] # same as web container restart: unless-stopped From ed5f18e10c91e33fd5ec705ab1c2b6d94ebf1faf Mon Sep 17 00:00:00 2001 From: Derkades Date: Tue, 28 Jul 2020 19:04:10 +0200 Subject: [PATCH 15/17] Revert "Update deployment guide" This reverts commit 1555d435f7bc89d87ac8cdb8be989b6679e62ec9. --- README.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 12940ac..6faa988 100644 --- a/README.md +++ b/README.md @@ -12,17 +12,14 @@ You have to manually install Docker first if you don't have it installed on your You will need to install [Docker Compose](https://docs.docker.com/compose/) for automated deploying. -```shell -$ apt install docker-compose # debian +```bash +sudo apt install docker-compose ``` -Download the example file, optionally change the directories, passwords, etc. then run it +Download the example file, optionally change the directories, passwords, etc. then run it with -```shell -$ git clone https://github.com/NamelessMC/Nameless-Docker.git -$ cd Nameless-Docker -$ vim docker-compose.dev.yaml -$ docker-compose up -d +```bash +docker-compose up -d ``` When the containers are up, visit the website in a browser to start the installer. By default it listens on any interface, port 80. From 036390f88f8324259418d3714a919f738abb243d Mon Sep 17 00:00:00 2001 From: Derkades Date: Tue, 28 Jul 2020 19:09:20 +0200 Subject: [PATCH 16/17] Include download link in instructions --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6faa988..99a0a2e 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,8 @@ You will need to install [Docker Compose](https://docs.docker.com/compose/) for sudo apt install docker-compose ``` -Download the example file, optionally change the directories, passwords, etc. then run it with - -```bash -docker-compose up -d -``` +Download [docker-compose.yml](https://github.com/NamelessMC/Nameless-Docker/raw/master/docker-compose.yml), optionally change some settings, then run `docker-compose up -d`. The default restart policy is `unless-stopped` so your website will start back up after a reboot. When the containers are up, visit the website in a browser to start the installer. By default it listens on any interface, port 80. -When the database configuration page shows up, fill in `db` for the *database address*. For database username, password and database name, fill `nameless` for all of them, if you used default database credentials. +When the database configuration page shows up, fill in `db` for *database address*. For database username, password and database name, fill `nameless` for all of them, if you used default database credentials. From 52fdac965e51338f624164d14584de84706b2f38 Mon Sep 17 00:00:00 2001 From: Derkades Date: Tue, 28 Jul 2020 19:12:24 +0200 Subject: [PATCH 17/17] Development file is in main repo --- README.md | 5 +++++ docker-compose.dev.yml | 22 ---------------------- 2 files changed, 5 insertions(+), 22 deletions(-) delete mode 100644 docker-compose.dev.yml diff --git a/README.md b/README.md index 99a0a2e..d32b095 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,8 @@ Download [docker-compose.yml](https://github.com/NamelessMC/Nameless-Docker/raw/ When the containers are up, visit the website in a browser to start the installer. By default it listens on any interface, port 80. When the database configuration page shows up, fill in `db` for *database address*. For database username, password and database name, fill `nameless` for all of them, if you used default database credentials. + + +## Development + +If you want to use Docker for developing NamelessMC, please see the [docker compose file in the main repo](https://github.com/NamelessMC/Nameless/blob/v2/docker-compose.yaml). \ No newline at end of file diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml deleted file mode 100644 index d0bd0f3..0000000 --- a/docker-compose.dev.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: '2' - -services: - - nginx: - build: nginx_web - ports: ['80:80'] - volumes: ['/srv/namelessmc/web:/data'] # same as php container - depends_on: [namelessmc_php] - - php: - build: php_fpm - volumes: ['/srv/namelessmc/web:/data'] # same as web container - - db: - image: mariadb - volumes: ['/srv/namelessmc/db:/var/lib/mysql'] - environment: - MYSQL_ROOT_PASSWORD: nameless - MYSQL_USER: nameless - MYSQL_PASSWORD: nameless - MYSQL_DATABASE: nameless