-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/docker #236
Open
slawkens
wants to merge
13
commits into
develop
Choose a base branch
from
feature/docker
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/docker #236
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
fee9d60
Create docker-compose.yml
slawkens e9b5617
Create Dockerfile
slawkens 86b94ea
Merge branch 'develop' into feature/docker
slawkens 03b2d71
[wip] docker setup
slawkens c503f5e
enable apcu & opcache
slawkens 72d7ee8
Speed up 20x? By removing volume
slawkens 49af260
Some features for docker users
slawkens a4b1631
Add missing file
slawkens 80a3a72
Update .gitignore
slawkens 42e40e5
Twig_SimpleFilter is deprecated
slawkens 5a94901
Merge branch 'develop' into feature/docker
slawkens d7e1ca7
Merge branch 'develop' into feature/docker
slawkens 5735d48
Merge branch 'develop' into feature/docker
slawkens File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -23,6 +23,7 @@ releases | |
tmp | ||
|
||
config.local.php | ||
!docker/config.local.php | ||
|
||
# all custom templates | ||
templates/* | ||
|
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,41 @@ | ||
version: "1.0" | ||
services: | ||
web: | ||
ports: | ||
- 8001:80 | ||
build: | ||
args: | ||
user: www-data | ||
uid: 33 | ||
context: ./ | ||
dockerfile: ./docker/Dockerfile | ||
restart: unless-stopped | ||
working_dir: /var/www/html | ||
depends_on: | ||
- db | ||
#volumes: | ||
# - ./:/var/www/html | ||
|
||
db: | ||
image: mysql:8.0 | ||
restart: unless-stopped # always? | ||
environment: | ||
MYSQL_RANDOM_ROOT_PASSWORD: "yes" | ||
MYSQL_DATABASE: myaac | ||
#MYSQL_ROOT_PASSWORD: root | ||
MYSQL_PASSWORD: myaac | ||
MYSQL_USER: myaac | ||
ports: | ||
- 8003:3306 | ||
volumes: | ||
- ./docker/tfs_schema.sql:/docker-entrypoint-initdb.d/tfs_schema.sql | ||
- db:/var/lib/mysql | ||
|
||
phpmyadmin: | ||
image: phpmyadmin | ||
restart: always | ||
ports: | ||
- 8002:80 | ||
|
||
volumes: | ||
db: |
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,53 @@ | ||
FROM php:8.2-apache | ||
|
||
ARG APCU_VERSION=5.1.22 | ||
|
||
# Arguments defined in docker-compose.yml | ||
ARG user | ||
ARG uid | ||
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
git \ | ||
curl \ | ||
libpng-dev \ | ||
libonig-dev \ | ||
libxml2-dev \ | ||
libzip-dev \ | ||
zip \ | ||
unzip \ | ||
nano \ | ||
vim | ||
|
||
# Clear cache | ||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# Install PHP extensions | ||
RUN docker-php-ext-install pdo pdo_mysql gd zip opcache | ||
RUN docker-php-ext-configure opcache --enable-opcache | ||
RUN pecl install apcu-${APCU_VERSION} && docker-php-ext-enable apcu | ||
|
||
# Get latest Composer | ||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer | ||
|
||
# Create system user to run Composer Commands | ||
#RUN useradd -G www-data,root -u $uid -d /home/$user $user | ||
RUN mkdir -p /home/$user/.composer && \ | ||
chown -R $user:$user /home/$user | ||
|
||
RUN chown -R www-data.www-data /var/www | ||
|
||
USER $user | ||
|
||
WORKDIR /home/$user | ||
RUN git clone https://github.com/otland/forgottenserver.git | ||
|
||
COPY --chown=www-data:www-data docker/config.lua /home/$user/forgottenserver | ||
COPY --chown=www-data:www-data docker/config.local.php /var/www/html | ||
|
||
#WORKDIR /home/$user/forgottenserver | ||
|
||
WORKDIR /var/www/html | ||
|
||
COPY --chown=www-data:www-data . . | ||
RUN composer install |
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,4 @@ | ||
<?php | ||
$config['installed'] = true; | ||
$config['server_path'] = '/home/www-data/forgottenserver'; | ||
$config['install_ignore_ip_check'] = true; |
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,12 @@ | ||
serverName = "Forgotten" | ||
mysqlHost = "db" | ||
mysqlUser = "myaac" | ||
mysqlPass = "myaac" | ||
mysqlDatabase = "myaac" | ||
mysqlPort = 3306 | ||
mysqlSock = "" | ||
|
||
ip = "192.168.176.1" | ||
statusPort = 7171 | ||
statusTimeout = 2000 | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend using multi-stage build to avoid building all of this each time and why not nginx?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any advantages of using nginx on single host for development purposes (this docker image is not intended for production).
About multi-stage build: thanks, didn't knew about that one. Will dive into it, and will see what can be done.