diff --git a/.env b/.env new file mode 100644 index 0000000..3f3f309 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +UID=1000 +CI_ENV=development diff --git a/.github/assets/controls.png b/.github/assets/controls.png deleted file mode 100644 index 5aee5cb..0000000 Binary files a/.github/assets/controls.png and /dev/null differ diff --git a/.github/assets/create_world.png b/.github/assets/create_world.png deleted file mode 100644 index d277115..0000000 Binary files a/.github/assets/create_world.png and /dev/null differ diff --git a/.github/assets/ingame.png b/.github/assets/ingame.png deleted file mode 100644 index b5db9ba..0000000 Binary files a/.github/assets/ingame.png and /dev/null differ diff --git a/.github/assets/lightning.png b/.github/assets/lightning.png deleted file mode 100644 index 0405596..0000000 Binary files a/.github/assets/lightning.png and /dev/null differ diff --git a/.github/assets/main_menu.png b/.github/assets/main_menu.png deleted file mode 100644 index 89aab80..0000000 Binary files a/.github/assets/main_menu.png and /dev/null differ diff --git a/.github/assets/night.png b/.github/assets/night.png deleted file mode 100644 index 9fea75b..0000000 Binary files a/.github/assets/night.png and /dev/null differ diff --git a/apache_log/error.log b/apache_log/error.log new file mode 100644 index 0000000..e69de29 diff --git a/apache_log/other_vhosts_access.log b/apache_log/other_vhosts_access.log new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..629d294 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +version: '3' +services: + game-web: + build: + context: . + dockerfile: docker/apache/Dockerfile + args: + uid: ${UID} + environment: + - APACHE_RUN_USER=#${UID} + - APACHE_RUN_GROUP=#${UID} + #- CI_ENV + - CI_CONFIG + restart: unless-stopped + volumes: + - ./:/var/www/html + - ./apache_log:/var/log/apache2 + ports: + - 9981:80 +volumes: + src: diff --git a/docker/apache/000-default.conf b/docker/apache/000-default.conf new file mode 100644 index 0000000..2d917cf --- /dev/null +++ b/docker/apache/000-default.conf @@ -0,0 +1,11 @@ + + ServerAdmin works@chiefsoft.com + ServerName oameye.works.wrenchboard.com + DocumentRoot /var/www/html + + + Options Indexes FollowSymLinks + AllowOverride All + Require all granted + + \ No newline at end of file diff --git a/docker/apache/Dockerfile b/docker/apache/Dockerfile new file mode 100644 index 0000000..eb8be6d --- /dev/null +++ b/docker/apache/Dockerfile @@ -0,0 +1,56 @@ +FROM php:7.4-apache +RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf +RUN apt-get update +RUN apt-get install -y \ + git \ + zip \ + curl \ + sudo \ + unzip \ + libicu-dev \ + libbz2-dev \ + libpng-dev \ + libjpeg-dev \ + libmcrypt-dev \ + libreadline-dev \ + libfreetype6-dev \ + libpq-dev \ + g++ + +RUN docker-php-ext-install \ + bz2 \ + intl \ + bcmath \ + opcache \ + calendar \ + pdo_mysql \ + mysqli \ + pdo \ + pdo_pgsql \ + pgsql + +# 2. set up document root for apache +COPY docker/apache/000-default.conf /etc/apache2/sites-available/000-default.conf + +# 3. mod_rewrite for URL rewrite and mod_headers for .htaccess extra headers like Access-Control-Allow-Origin- +RUN a2enmod rewrite headers + +# 4. start with base php config, then add extensions +RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" + +# 5. Composer +RUN curl -sS https://getcomposer.org/installer | php +RUN mv composer.phar /usr/local/bin/composer +RUN chmod +x /usr/local/bin/composer +RUN composer self-update + +COPY / /var/www/html/ +# 6. we need a user with the same UID/GID with host user +# so when we execute CLI commands, all the host file's ownership remains intact +# otherwise command from inside container will create root-owned files and directories +ARG uid=1000 +RUN useradd -G www-data,root -u $uid -d /home/devuser devuser +RUN mkdir -p /home/devuser/.composer && \ + chown -R devuser:devuser /home/devuser + +EXPOSE 80 \ No newline at end of file