baseline: OpenMU upstream b5a0961 (fresh source)
This commit is contained in:
25
deploy/all-in-one/.dockerignore
Normal file
25
deploy/all-in-one/.dockerignore
Normal file
@@ -0,0 +1,25 @@
|
||||
**/.classpath
|
||||
**/.dockerignore
|
||||
**/.env
|
||||
**/.git
|
||||
**/.gitignore
|
||||
**/.project
|
||||
**/.settings
|
||||
**/.toolstarget
|
||||
**/.vs
|
||||
**/.vscode
|
||||
**/*.*proj.user
|
||||
**/*.dbmdl
|
||||
**/*.jfm
|
||||
**/azds.yaml
|
||||
**/bin
|
||||
**/charts
|
||||
**/docker-compose*
|
||||
**/Dockerfile*
|
||||
**/node_modules
|
||||
**/npm-debug.log
|
||||
**/obj
|
||||
**/secrets.dev.yaml
|
||||
**/values.dev.yaml
|
||||
LICENSE
|
||||
README.md
|
||||
7
deploy/all-in-one/.htpasswd
Normal file
7
deploy/all-in-one/.htpasswd
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file contains the passwords for the admin panel and tracing.
|
||||
# Change these passwords in production!
|
||||
# default is admin:openmu, hashed with bcrypt.
|
||||
|
||||
admin:$2y$10$xYL2d/QEukwGmX0uNZubsunL0qcANuTYkpapRVdlu5q3ymCpvOEh.
|
||||
|
||||
# this file should always end with an empty line!
|
||||
89
deploy/all-in-one/README.md
Normal file
89
deploy/all-in-one/README.md
Normal file
@@ -0,0 +1,89 @@
|
||||
# All-in-one deployment
|
||||
|
||||
The all in one deployment is recommended, if you want to host on a small machine
|
||||
with a low amount of players.
|
||||
|
||||
In this case, all kinds of OpenMU subsystems (ConnectServer, GameServer, LoginServer,
|
||||
AdminPanel, ...) are running in one process.
|
||||
|
||||
## Deployment with docker-compose
|
||||
|
||||
### Install GIT
|
||||
|
||||
See [https://github.com/git-guides/install-git](https://github.com/git-guides/install-git).
|
||||
|
||||
### Clone the repository
|
||||
|
||||
`git clone https://github.com/MUnique/OpenMU.git`
|
||||
|
||||
It will create a new folder OpenMU with the repository contents inside.
|
||||
|
||||
### Navigate to the docker-compose files
|
||||
|
||||
Navigate to the folder deploy/all-in-one
|
||||
|
||||
`cd deploy/all-in-one`
|
||||
|
||||
### Option A - for local testing
|
||||
|
||||
To use the official docker image, just run:
|
||||
|
||||
`docker compose up -d --no-build`
|
||||
|
||||
And that's it. It's then available on your local computer through a loopback ip.
|
||||
|
||||
However, if you want to make it available through the internet, you should choose
|
||||
Option B:
|
||||
|
||||
### Option B - with HTTPS
|
||||
|
||||
If you want to share your server with the world, it's recommended to set up HTTPS
|
||||
for nginx. Otherwise, traffic from and to the admin panel is not encrypted.
|
||||
|
||||
#### Set your domain name as environment variable
|
||||
|
||||
Specify the environment variable ```DOMAIN_NAME``` for docker compose.
|
||||
This can be done in [various ways](https://docs.docker.com/compose/environment-variables/set-environment-variables/),
|
||||
e.g. by editing the ```docker-compose.prod.yml``` or
|
||||
[setting it in your shell](https://phoenixnap.com/kb/linux-set-environment-variable).
|
||||
|
||||
This variable is replaced in the nginx template config files which get included
|
||||
in the other configuration files.
|
||||
|
||||
#### Run it
|
||||
|
||||
`docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d`
|
||||
|
||||
#### Run certbot explicitly
|
||||
|
||||
Hint: replace "example.org" with your domain.
|
||||
|
||||
`docker compose -f docker-compose.yml -f docker-compose.prod.yml run --rm certbot certonly --webroot --webroot-path /var/www/certbot/ -d example.org`
|
||||
|
||||
#### Set up certificate renewal
|
||||
|
||||
Because your certificates expire after 3 months, it's recommended to renew them regularly.
|
||||
To renew it, run this command:
|
||||
|
||||
`docker compose -f docker-compose.yml -f docker-compose.prod.yml run --rm certbot renew`
|
||||
|
||||
Of course, it would make sense to add a cron job (e.g. once a week) on your host
|
||||
machine for that.
|
||||
|
||||
## What's next
|
||||
|
||||
The server is automatically started and initialized for Season 6. You can start
|
||||
playing, if you want :-)
|
||||
|
||||
Additionally, take a look at the AdminPanel.
|
||||
|
||||
If your containers run on docker at your local machine, you can simply go to `http://localhost/`.
|
||||
The default username is 'admin', the password 'openmu'. You should change that later.
|
||||
|
||||
If you want to run another game version, you can go to the setup page through
|
||||
the navigation menu, where you can select your desired game version,
|
||||
number of game servers (just the data of it), and if test accounts
|
||||
should be created.
|
||||
|
||||
If you click on 'Install', wait a bit until the database is set up and filled with the
|
||||
data and voila, OpenMU is ready to use.
|
||||
30
deploy/all-in-one/docker-compose-all-in-one.dcproj
Normal file
30
deploy/all-in-one/docker-compose-all-in-one.dcproj
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk">
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectVersion>2.1</ProjectVersion>
|
||||
<DockerTargetOS>Linux</DockerTargetOS>
|
||||
<ProjectGuid>6518d58a-5f07-4341-87af-fcf3715d2554</ProjectGuid>
|
||||
<DockerLaunchAction>None</DockerLaunchAction>
|
||||
<DockerServiceUrl>{Scheme}://localhost:{ServicePort}</DockerServiceUrl>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<DockerServiceName>openmu-startup</DockerServiceName>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include="docker-compose.override.yml">
|
||||
<DependentUpon>docker-compose.yml</DependentUpon>
|
||||
</None>
|
||||
<None Include="docker-compose.prod.yml">
|
||||
<DependentUpon>docker-compose.yml</DependentUpon>
|
||||
</None>
|
||||
<None Include="docker-compose.yml" />
|
||||
<None Include=".dockerignore" />
|
||||
<None Include=".htpasswd" />
|
||||
<None Include="nginx\nginx.dev.conf" />
|
||||
<None Include="nginx\nginx.prod443.conf" />
|
||||
<None Include="nginx\nginx.prod80.conf" />
|
||||
<None Include="nginx\templates\nginx.prod.certificates.conf.template" />
|
||||
<None Include="nginx\templates\nginx.server_name.conf.template" />
|
||||
<None Include="README.md" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
13
deploy/all-in-one/docker-compose.override.yml
Normal file
13
deploy/all-in-one/docker-compose.override.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
services:
|
||||
|
||||
openmu-startup:
|
||||
build:
|
||||
context: ../../src
|
||||
dockerfile: Startup/Dockerfile
|
||||
restart: "no"
|
||||
ports:
|
||||
- "8081:8080"
|
||||
|
||||
database:
|
||||
ports:
|
||||
- "5433:5432"
|
||||
46
deploy/all-in-one/docker-compose.prod.yml
Normal file
46
deploy/all-in-one/docker-compose.prod.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
services:
|
||||
openmu-startup:
|
||||
restart: "unless-stopped"
|
||||
environment:
|
||||
ASPNETCORE_ENVIRONMENT: Production
|
||||
|
||||
database:
|
||||
restart: "unless-stopped"
|
||||
|
||||
nginx-80:
|
||||
restart: "unless-stopped"
|
||||
environment:
|
||||
DOMAIN_NAME: ${DOMAIN_NAME}
|
||||
volumes:
|
||||
- ./nginx/nginx.prod80.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./.htpasswd:/etc/nginx/.htpasswd
|
||||
- ./certbot/www:/var/www/certbot/:ro
|
||||
- ./nginx/templates/nginx.server_name.conf.template:/etc/nginx/templates/nginx.server_name.conf.template:ro
|
||||
|
||||
# We add another nginx here, just for HTTPs.
|
||||
# The reason is, that it's not starting when we combine port 80 and 443 until
|
||||
# the certificates are created.
|
||||
# So, when running the certbot the first time, we need to be able to access
|
||||
# the port 80 - and we solve this by separating the server configs.
|
||||
nginx-443:
|
||||
image: nginx:alpine
|
||||
container_name: nginx-443
|
||||
restart: "unless-stopped"
|
||||
environment:
|
||||
DOMAIN_NAME: ${DOMAIN_NAME}
|
||||
ports:
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ./nginx/nginx.prod443.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./.htpasswd:/etc/nginx/.htpasswd
|
||||
- ./certbot/conf/:/etc/nginx/ssl/:ro
|
||||
- ./nginx/templates/nginx.server_name.conf.template:/etc/nginx/templates/nginx.server_name.conf.template:ro
|
||||
- ./nginx/templates/nginx.prod.certificates.conf.template:/etc/nginx/templates/nginx.prod.certificates.conf.template:ro
|
||||
depends_on:
|
||||
- openmu-startup
|
||||
|
||||
certbot:
|
||||
image: certbot/certbot:latest
|
||||
volumes:
|
||||
- ./certbot/www/:/var/www/certbot/:rw
|
||||
- ./certbot/conf/:/etc/letsencrypt/:rw
|
||||
49
deploy/all-in-one/docker-compose.yml
Normal file
49
deploy/all-in-one/docker-compose.yml
Normal file
@@ -0,0 +1,49 @@
|
||||
services:
|
||||
nginx-80:
|
||||
image: nginx:alpine
|
||||
container_name: nginx-80
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- ./nginx/nginx.dev.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./.htpasswd:/etc/nginx/.htpasswd
|
||||
depends_on:
|
||||
- openmu-startup
|
||||
|
||||
openmu-startup:
|
||||
image: munique/openmu
|
||||
container_name: openmu-startup
|
||||
ports:
|
||||
- "8080"
|
||||
- "55901:55901"
|
||||
- "55902:55902"
|
||||
- "55903:55903"
|
||||
- "55904:55904"
|
||||
- "55905:55905"
|
||||
- "55906:55906"
|
||||
- "44405:44405"
|
||||
- "44406:44406"
|
||||
- "55980:55980"
|
||||
environment:
|
||||
DB_HOST: database
|
||||
ASPNETCORE_URLS: http://+:8080
|
||||
working_dir: /app/
|
||||
volumes:
|
||||
- ./.htpasswd:/etc/nginx/.htpasswd
|
||||
depends_on:
|
||||
- database
|
||||
|
||||
database:
|
||||
image: postgres
|
||||
container_name: database
|
||||
environment:
|
||||
POSTGRES_PASSWORD: admin
|
||||
POSTGRES_DB: openmu
|
||||
POSTGRES_USER: postgres
|
||||
ports:
|
||||
- "5432"
|
||||
volumes:
|
||||
- dbdata:/var/lib/postgresql #store data on volume
|
||||
|
||||
volumes:
|
||||
dbdata:
|
||||
26
deploy/all-in-one/nginx/nginx.dev.conf
Normal file
26
deploy/all-in-one/nginx/nginx.dev.conf
Normal file
@@ -0,0 +1,26 @@
|
||||
events {
|
||||
}
|
||||
|
||||
http {
|
||||
# this is required to proxy Grafana Live WebSocket connections.
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
server {
|
||||
auth_basic "Protected Site";
|
||||
auth_basic_user_file /etc/nginx/.htpasswd;
|
||||
|
||||
listen 80;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
resolver 127.0.0.11 ipv6=off;
|
||||
|
||||
location / {
|
||||
proxy_pass http://openmu-startup:8080;
|
||||
}
|
||||
}
|
||||
}
|
||||
32
deploy/all-in-one/nginx/nginx.prod443.conf
Normal file
32
deploy/all-in-one/nginx/nginx.prod443.conf
Normal file
@@ -0,0 +1,32 @@
|
||||
events {
|
||||
}
|
||||
|
||||
http {
|
||||
# this is required to proxy Grafana Live WebSocket connections.
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 default_server ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
|
||||
include conf.d/nginx.server_name.conf;
|
||||
include conf.d/nginx.prod.certificates.conf;
|
||||
|
||||
auth_basic "Protected Site";
|
||||
auth_basic_user_file /etc/nginx/.htpasswd;
|
||||
|
||||
listen 80;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
resolver 127.0.0.11 ipv6=off;
|
||||
|
||||
location / {
|
||||
proxy_pass http://openmu-startup:8080;
|
||||
}
|
||||
}
|
||||
}
|
||||
20
deploy/all-in-one/nginx/nginx.prod80.conf
Normal file
20
deploy/all-in-one/nginx/nginx.prod80.conf
Normal file
@@ -0,0 +1,20 @@
|
||||
events {
|
||||
}
|
||||
|
||||
http {
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
include conf.d/nginx.server_name.conf;
|
||||
server_tokens off;
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location / {
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
ssl_certificate /etc/nginx/ssl/live/$DOMAIN_NAME/fullchain.pem;
|
||||
ssl_certificate_key /etc/nginx/ssl/live/$DOMAIN_NAME/privkey.pem;
|
||||
@@ -0,0 +1 @@
|
||||
server_name $DOMAIN_NAME;
|
||||
Reference in New Issue
Block a user