-
Notifications
You must be signed in to change notification settings - Fork 12
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 #418 from OGSteam/feature/docker-alpine
Move to docker-alpine
- Loading branch information
Showing
23 changed files
with
266 additions
and
236 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
FROM nginx:stable-alpine AS base | ||
|
||
RUN printf "\ | ||
server {\n\ | ||
listen 80;\n\ | ||
index index.php index.html;\n\ | ||
error_log /var/log/nginx/error.log;\n\ | ||
access_log /var/log/nginx/access.log;\n\ | ||
root /var/www/html;\n\ | ||
location ~ \.php$ {\n\ | ||
try_files \$uri =404;\n\ | ||
fastcgi_split_path_info ^(.+\.php)(/.+)$;\n\ | ||
fastcgi_pass ogspy:9000;\n\ | ||
fastcgi_index index.php;\n\ | ||
include fastcgi_params;\n\ | ||
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;\n\ | ||
fastcgi_param PATH_INFO \$fastcgi_path_info;\n\ | ||
}\n\ | ||
location / {\n\ | ||
try_files \$uri \$uri/ /index.php?\$query_string;\n\ | ||
gzip_static on;\n\ | ||
}\n\ | ||
}\n" > /etc/nginx/conf.d/default.conf | ||
|
||
EXPOSE 80 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
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,80 @@ | ||
FROM php:8.3-fpm-alpine3.20 AS build | ||
|
||
RUN apk --no-cache add php-session \ | ||
php-tokenizer \ | ||
php-xml \ | ||
php-ctype \ | ||
php-curl \ | ||
php-dom \ | ||
php-fileinfo \ | ||
php-mbstring \ | ||
php-openssl \ | ||
php-pdo \ | ||
php-pdo_mysql \ | ||
php-mysqli \ | ||
php-session \ | ||
php-tokenizer \ | ||
php-xml \ | ||
php-ctype \ | ||
php-xmlwriter \ | ||
php-simplexml \ | ||
php-zip \ | ||
libzip-dev \ | ||
git \ | ||
composer | ||
|
||
RUN docker-php-ext-install mysqli pdo_mysql zip | ||
RUN docker-php-ext-enable mysqli pdo_mysql zip | ||
|
||
# RUN apk --no-cache add --update nodejs npm | ||
|
||
# Get OGSpy | ||
RUN git clone -b develop https://github.com/ogsteam/ogspy /var/www/html | ||
|
||
# Get OGSpy Mods | ||
RUN git clone -b master https://github.com/ogsteam/mod-allyranking /var/www/html/mod/allyranking | ||
RUN git clone -b master https://github.com/ogsteam/mod-attaques /var/www/html/mod/attaques | ||
RUN git clone -b master https://github.com/ogsteam/mod-autonomie /var/www/html/mod/autonomie | ||
RUN git clone -b master https://github.com/ogsteam/mod-autoupdate /var/www/html/mod/autoupdate | ||
RUN git clone -b master https://github.com/ogsteam/mod-bthof /var/www/html/mod/bthof | ||
RUN git clone -b master https://github.com/ogsteam/mod-cdr /var/www/html/mod/cdr | ||
RUN git clone -b master https://github.com/ogsteam/mod-densite /var/www/html/mod/densite | ||
RUN git clone -b master https://github.com/ogsteam/mod-emspyre /var/www/html/mod/emspyre | ||
RUN git clone -b master https://github.com/ogsteam/mod-expedition /var/www/html/mod/expedition | ||
RUN git clone -b master https://github.com/ogsteam/mod-flottes /var/www/html/mod/flottes | ||
RUN git clone -b master https://github.com/ogsteam/mod-gestionmod /var/www/html/mod/gestionmod | ||
RUN git clone -b master https://github.com/ogsteam/mod-graviton /var/www/html/mod/graviton | ||
RUN git clone -b master https://github.com/ogsteam/mod-hof /var/www/html/mod/hof | ||
RUN git clone -b master https://github.com/ogsteam/mod-hofrc /var/www/html/mod/hofrc | ||
RUN git clone -b master https://github.com/ogsteam/mod-inactifs /var/www/html/mod/inactifs | ||
RUN git clone -b master https://github.com/ogsteam/mod-majvisu /var/www/html/mod/majvisu | ||
RUN git clone -b master https://github.com/ogsteam/mod-ogscalc /var/www/html/mod/ogscalc | ||
RUN git clone -b master https://github.com/ogsteam/mod-oversight /var/www/html/mod/oversight | ||
RUN git clone -b master https://github.com/ogsteam/mod-production /var/www/html/mod/production | ||
RUN git clone -b master https://github.com/ogsteam/mod-quimsonde /var/www/html/mod/quimsonde | ||
RUN git clone -b master https://github.com/ogsteam/mod-recycleurs /var/www/html/mod/recycleurs | ||
RUN git clone -b master https://github.com/ogsteam/mod-sign /var/www/html/mod/sign | ||
RUN git clone -b master https://github.com/ogsteam/mod-superapix /var/www/html/mod/superapix | ||
RUN git clone -b master https://github.com/ogsteam/mod-tempsvols /var/www/html/mod/tempsvols | ||
RUN git clone -b master https://github.com/ogsteam/mod-timeobservatory /var/www/html/mod/timeobservatory | ||
RUN git clone -b master https://github.com/ogsteam/mod-varally /var/www/html/mod/varally | ||
RUN git clone -b master https://github.com/ogsteam/mod-xtense /var/www/html/mod/xtense | ||
|
||
WORKDIR /var/www/html | ||
|
||
RUN composer install --prefer-dist --no-progress --no-dev | ||
# RUN npm install | ||
|
||
EXPOSE 9000 | ||
|
||
RUN printf "\ | ||
rm -Rf /var/www/html/install\n\ | ||
rm -Rf /var/www/html/.git\n\ | ||
chmod -R o+w /var/www/html/\n\ | ||
chown -R root:root /var/www/html/\n\ | ||
php-fpm\n\ | ||
" > /start.sh | ||
|
||
RUN chmod +x "/start.sh" | ||
|
||
ENTRYPOINT "/start.sh" |
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 |
---|---|---|
@@ -1,22 +1,44 @@ | ||
|
||
# OGSpy Docker | ||
|
||
PHP 7.06 Maria DB | ||
This is the environment to test your development Branch. | ||
|
||
It contains all the necessary tools to run OGSpy.: | ||
|
||
- Alpine Linux | ||
- NGINX | ||
- Maria DB | ||
- PHP 8.3 | ||
- PHPMyAdmin | ||
|
||
## Run Locally | ||
|
||
Run the Docker Compose to set up the environment. | ||
|
||
```bash | ||
docker.exe compose -f docker-compose.yml -p my-ogspy up -d | ||
``` | ||
|
||
## Connect to OGSpy | ||
|
||
http://127.0.0.1:16005/ | ||
|
||
User : ogsteam | ||
Password : ogsteam | ||
|
||
Based on work done by tutumcloud | ||
https://github.com/tutumcloud/lamp | ||
## Connect to PHPMyAdmin | ||
|
||
## Usage | ||
http://127.0.0.1:16006/ | ||
|
||
- Get the image: `docker pull ogsteam/ogspy` | ||
User : root | ||
Password : password | ||
|
||
- Run the image: `docker run -d -p80:80 --name ogspy_container ogsteam/ogspy` | ||
## Volumes | ||
|
||
- Install OGSpy with Database settings: | ||
Open with your browser http://127.0.0.1 (The page could appear after some time corresponding to the service startup time) | ||
The image will create the following volumes to let you see your files in your local environment. | ||
- `ogspy-db` - MariaDB | ||
- `ogspy-app` - NGINX + OGSPY | ||
|
||
> Database : ogspy | ||
> user : ogsteam | ||
> password : password | ||
## Customize your image | ||
|
||
- When installation is finished remove install Folder: | ||
`docker exec ogspy_container rm -Rf /app/install` | ||
You can edit the `Dockerfile.ogspy` file to customize your image and select a customer branch to test and the PHP Version. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
-- create the databases | ||
CREATE DATABASE IF NOT EXISTS ogspy; | ||
|
||
-- create the users for each database | ||
CREATE USER 'admin'@'%' IDENTIFIED BY 'ogsteam'; | ||
GRANT CREATE, ALTER, INDEX, LOCK TABLES, REFERENCES, UPDATE, DELETE, DROP, SELECT, INSERT ON `ogspy`.* TO 'admin'@'%'; | ||
|
||
FLUSH PRIVILEGES; |
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,24 @@ | ||
|
||
USE `ogspy`; | ||
|
||
-- ----------------------------------------------------------------------------- | ||
-- Partie spécifique pour le docker | ||
-- ----------------------------------------------------------------------------- | ||
-- ----------------------------------------------------------------------------- | ||
INSERT INTO `ogspy_config` VALUES ('num_of_galaxies','9'); | ||
INSERT INTO `ogspy_config` VALUES ('num_of_systems','499'); | ||
INSERT INTO `ogspy_config` VALUES ('speed_uni','1'); | ||
INSERT INTO `ogspy_config` VALUES ('speed_fleet_peaceful','1'); | ||
INSERT INTO `ogspy_config` VALUES ('speed_fleet_war','1'); | ||
INSERT INTO `ogspy_config` VALUES ('speed_fleet_holding','1'); | ||
INSERT INTO `ogspy_config` VALUES ('speed_research_divisor','1'); | ||
INSERT INTO `ogspy_config` VALUES ('version','3.3.9-dev'); | ||
INSERT INTO `ogspy_config` VALUES ('log_phperror', '1'); | ||
INSERT INTO `ogspy_user` (`user_id`, `user_name`, `user_password_s`, `user_regdate`, `user_active`, `user_admin`, `user_class`, `user_pwd_change`) VALUES (1, 'ogsteam', '$2y$10$z.6/280zsg65IoOJ/wmOC.cHIWFnKFE8TaY7JSr0DH3fnQsxg7rRW', '1567070548', '1', '1', 'COL', 0); | ||
INSERT INTO `ogspy_user_group` (`group_id`, `user_id`) VALUES (1, 1); | ||
|
||
INSERT INTO `ogspy_user_building` (`user_id`, `planet_id`, `planet_name`, `coordinates`, `fields`, `boosters`, `temperature_min`, `temperature_max`, `Sat`, `Sat_percentage`, `FOR`, `FOR_percentage`, `M`, `M_percentage`, `C`, `C_Percentage`, `D`, `D_percentage`, `CES`, `CES_percentage`, `CEF`, `CEF_percentage`, `UdR`, `UdN`, `CSp`, `HM`, `HC`, `HD`, `Lab`, `Ter`, `DdR`, `Silo`, `Dock`, `BaLu`, `Pha`, `PoSa`) | ||
VALUES (1, 101, 'area' , '2:330:12', 282, 'm:0:0_c:0:0_d:0:0_e:0:0_p:0_m:0', -31, 9, 2010, 100, 848, 150, 38, 100, 34, 100, 34, 100, 12, 100, 23, 60, 7, 7, 12, 13, 9, 8, 18, 8, 1, 8, 7, 0, 0, 0); | ||
|
||
INSERT INTO `ogspy_user_technology` (`user_id`, `Esp`, `Ordi`, `Armes`, `Bouclier`, `Protection`, `NRJ`, `Hyp`, `RC`, `RI`, `PH`, `Laser`, `Ions`, `Plasma`, `RRI`, `Graviton`, `Astrophysique`) VALUES | ||
(1, 20, 20, 20, 20, 20, 20, 17, 20, 17, 16, 20, 20, 19, 12, 2, 23); |
Oops, something went wrong.