Some adjustments and improvements for docker.
This commit is contained in:
parent
9e4eb6a4b5
commit
f947c51a79
4 changed files with 70 additions and 43 deletions
74
README.md
74
README.md
|
@ -7,52 +7,74 @@ This web interface aims to be as simple as possible. The minimalistic approach i
|
||||||
If you like to help (to translate or implement features), open an issue first. If possible, you should use existing code to implement new features. PRs will be merged after a code review.
|
If you like to help (to translate or implement features), open an issue first. If possible, you should use existing code to implement new features. PRs will be merged after a code review.
|
||||||
|
|
||||||
Features which are currently not supported:
|
Features which are currently not supported:
|
||||||
- Permissions Management (except for viewing)
|
|
||||||
- File Management (except for viewing)
|
* Permissions Management (except for viewing)
|
||||||
|
* File Management (except for viewing)
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
The main configuration file is the `env` file located in `config/`. There's an example file called `env.example` which you
|
||||||
|
need to copy to `config/env`.
|
||||||
|
|
||||||
|
**Information for docker users**: it's possible to have the `env` file persistent and not within the container so
|
||||||
|
that rebuilding the image isn't required. Create a host volume `/path/from/host/env` and map it to
|
||||||
|
`/var/www/html/application/config/env`. Changes will show up after restarting the container.
|
||||||
|
|
||||||
## Install / Deployment
|
## Install / Deployment
|
||||||
|
|
||||||
You can either use docker or manual deployment.
|
You can either use docker or manual deployment. Please read the following section carefully.
|
||||||
|
|
||||||
### Docker
|
### Automatic installation and deployment with docker or docker-compose
|
||||||
|
|
||||||
#### Install
|
##### Install
|
||||||
|
|
||||||
There's an example `docker-compose.yml` in the `docker-compose/` directory. Please read the following section carefully as the setup will be explained.
|
###### docker
|
||||||
|
|
||||||
* Clone repository
|
* Clone repository
|
||||||
* Copy `config/env.example` to `config/env` and adjust to your needs. Ensure that if you share the same docker network, the environment variable `teamspeak_default_host` should be the name of your teamspeak docker container.
|
* Copy either `config/env.example` to `config/env` and adjust to your needs or make it persistent outside if the container. To do so take a look at the configuration section first). Ensure that if you share the same docker network, the environment variable `teamspeak_default_host` should be the name of your teamspeak docker container.
|
||||||
* Build the docker image from the project home with `docker build -t ts3web:latest -f docker/Dockerfile .`
|
* Build the docker image from the project home with `docker build -t teamspeak_web:latest -f docker/Dockerfile .`
|
||||||
* Create a container with the image. Make sure that if teamspeak and ts3web share the same docker instance they should be put into one network and the subnet should be added to teamspeak's query whitelist. The web interface won't work otherwise.
|
* Create a container with the image, e.g. `docker run --name teamspeak_web -p 8181:80 slimblog_app:latest`. Make sure that if teamspeak and ts3web share the same docker instance they should be put into one network and the subnet **needs be added to teamspeak's query whitelist**. The web interface won't work otherwise.
|
||||||
|
* Point your browser to `8181` to see the web interface.
|
||||||
|
|
||||||
From the example:
|
###### docker-compose
|
||||||
|
|
||||||
* Copy `docker-compose/env` file to `config/env`
|
There's an example `docker-compose.yml` in the `docker-compose/` directory.
|
||||||
* Build the docker image from the project home with `docker build -t ts3web:latest -f docker/Dockerfile .`
|
|
||||||
|
* Adjust `docker-compose/env` if you need to change something.
|
||||||
|
* Build the docker image from the project home with `docker build -t teamspeak_web:latest -f docker/Dockerfile .`
|
||||||
* Change directory to `docker-compose/` folder
|
* Change directory to `docker-compose/` folder
|
||||||
* Execute `docker-compose up -d`
|
* Execute `docker-compose up -d`
|
||||||
* Everything should be up and running. Point your browser to `8181` to see the web interface, look into the logs for a teamspeak serveradmin login.
|
* Point your browser to `8080` to see the web interface.
|
||||||
|
|
||||||
#### Upgrade
|
##### Upgrade
|
||||||
|
|
||||||
|
###### docker
|
||||||
|
|
||||||
* Change directory to project home
|
* Change directory to project home
|
||||||
* `git pull`
|
* `git pull`
|
||||||
|
* Build the docker image from the project home with `docker build -t teamspeak_web:latest -f docker/Dockerfile .`
|
||||||
|
* Re-create app container with latest image
|
||||||
|
|
||||||
|
###### docker-compose
|
||||||
|
|
||||||
|
* Change directory to project home
|
||||||
|
* `git pull`
|
||||||
|
* Build the docker image from the project home with `docker build -t teamspeak_web:latest -f docker/Dockerfile .`
|
||||||
* Change directory to `docker-compose/` folder
|
* Change directory to `docker-compose/` folder
|
||||||
* Execute `docker-compose down`
|
* Execute `docker-compose down`
|
||||||
* Execute `docker-compose up -d`
|
* Execute `docker-compose up -d`
|
||||||
|
|
||||||
### Manual
|
### Manual installation and deployment
|
||||||
|
|
||||||
#### Install
|
#### Install
|
||||||
|
|
||||||
* Clone repository
|
* Clone repository
|
||||||
* Install composer
|
* Install composer
|
||||||
* Change directory to project home
|
* Change directory to project home
|
||||||
|
* Execute `composer install`
|
||||||
* `composer install`
|
* `composer install`
|
||||||
|
|
||||||
#### Configuration
|
#### Web server
|
||||||
|
|
||||||
* Copy `config/env.example` to `config/env` and adjust to your needs
|
|
||||||
* Configure nginx or apache.
|
* Configure nginx or apache.
|
||||||
* Point your document root to `public/`.
|
* Point your document root to `public/`.
|
||||||
* Example `nginx.conf`:
|
* Example `nginx.conf`:
|
||||||
|
@ -78,6 +100,7 @@ From the example:
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
* Everything should be up and running. Point your browser to `8080` to see the web interface.
|
||||||
|
|
||||||
#### Upgrade
|
#### Upgrade
|
||||||
|
|
||||||
|
@ -85,11 +108,11 @@ From the example:
|
||||||
* `git pull`
|
* `git pull`
|
||||||
* `composer update`
|
* `composer update`
|
||||||
|
|
||||||
## Developers
|
### Contributions & Development
|
||||||
* start server with `php -S localhost:8080 -t public public/index.php`
|
* Follow manual install guide but use the internal server with `php -S localhost:8080 -t public public/index.php`
|
||||||
* point browser to [localhost:8080](http://localhost:8080) to have a preview
|
* Point browser to [localhost:8080](http://localhost:8080)
|
||||||
|
|
||||||
### Helpers
|
#### Helpers
|
||||||
|
|
||||||
Attributes can be defined when including `table`, `keyvalues` and `form` templates of twig. This helps to generate tables and forms without the need to specify all attributes.
|
Attributes can be defined when including `table`, `keyvalues` and `form` templates of twig. This helps to generate tables and forms without the need to specify all attributes.
|
||||||
|
|
||||||
|
@ -105,10 +128,9 @@ fields // define fields for a form
|
||||||
|
|
||||||
See example usage in the folder `View/material`.
|
See example usage in the folder `View/material`.
|
||||||
|
|
||||||
## Translations
|
#### Translations
|
||||||
- This app uses Symfony Translator. It's bootstrapped in `Util\BootstrapHelper` and locales are placed under `data/locale/`. Adjust to your needs or help translating.
|
- This app uses Symfony Translator. It's bootstrapped in `Util\BootstrapHelper` and locales are placed under `data/locale/`. Adjust to your needs or help translating.
|
||||||
- Form fields (name/id should be the same) are also translated. For a field named `content` or `ConT enT` translate `form_field_content`.
|
- Form fields (name/id should be the same) are also translated. For a field named `content` or `ConT enT` translate `form_field_content`.
|
||||||
|
|
||||||
|
#### Theme
|
||||||
## Theme
|
Themes can be chosen in the `env` file by editing the `theme` variable. Templates are mapped to the corresponding view folder in `src/View/<themeName>`. `.css`, `.js` and other style files like `.ttf` or `.woff2` for fonts should be placed in `public/theme/<themeName>` and accessed accordingly. See an example in `src/View/boostrap4/layout.twig`.
|
||||||
Themes can be chosen in the `env` file by editing the `theme` variable. Templates are mapped to the corresponding view folder in `src/View/<themeName>`. `.css`, `.js` and other style files like `.ttf` or `.woff2` for fonts should be placed in `public/theme/<themeName>` and accessed accordingly. See an example in `src/View/material/layout/header.twig`.
|
|
|
@ -25,9 +25,13 @@ services:
|
||||||
- network
|
- network
|
||||||
web:
|
web:
|
||||||
container_name: teamspeak_web
|
container_name: teamspeak_web
|
||||||
image: ts3web:latest
|
image: teamspeak_web:latest
|
||||||
|
volumes:
|
||||||
|
- ./env:/var/www/html/application/config/env
|
||||||
ports:
|
ports:
|
||||||
- 8181:80
|
- 8181:80
|
||||||
|
depends_on:
|
||||||
|
- app
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- network
|
- network
|
|
@ -1,25 +1,26 @@
|
||||||
FROM phpearth/php:7.3-nginx
|
FROM phpearth/php:7.3-nginx
|
||||||
|
|
||||||
# install deps
|
# install deps
|
||||||
RUN apk add --no-cache git
|
RUN apk add --no-cache git \
|
||||||
RUN apk add --no-cache composer
|
&& apk add --no-cache composer
|
||||||
|
|
||||||
# adjust nginx
|
# adjust nginx
|
||||||
COPY docker/default.conf /etc/nginx/conf.d/default.conf
|
COPY docker/default.conf /etc/nginx/conf.d/default.conf
|
||||||
COPY docker/nginx.conf /etc/nginx/nginx.conf
|
COPY docker/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|
||||||
# copy application and set permissions
|
# copy application and set permissions
|
||||||
RUN mkdir -p /var/www/html/ts3web/bin/
|
COPY config/ /var/www/html/application/config/
|
||||||
COPY config/ /var/www/html/ts3web/config/
|
COPY data/ /var/www/html/application/data/
|
||||||
RUN mkdir -p /var/www/html/ts3web/cache/
|
COPY public/ /var/www/html/application/public/
|
||||||
ADD data/ /var/www/html/ts3web/data/
|
COPY src/ /var/www/html/application/src/
|
||||||
RUN chmod -R 777 /var/www/html/ts3web/data/
|
COPY composer.json /var/www/html/application/composer.json
|
||||||
RUN mkdir -p /var/www/html/ts3web/log/
|
RUN mkdir -p /var/www/html/application/bin/ \
|
||||||
RUN touch /var/www/html/ts3web/log/application.log
|
&& mkdir -p /var/www/html/application/cache/ \
|
||||||
RUN chmod 777 /var/www/html/ts3web/log/application.log
|
&& chmod -R 777 /var/www/html/application/data/ \
|
||||||
ADD public/ /var/www/html/ts3web/public/
|
&& mkdir -p /var/www/html/application/log/ \
|
||||||
ADD src/ /var/www/html/ts3web/src/
|
&& touch /var/www/html/application/log/application.log \
|
||||||
ADD composer.json /var/www/html/ts3web/composer.json
|
&& chmod 777 /var/www/html/application/log/application.log
|
||||||
|
|
||||||
# initialize app
|
# initialize app
|
||||||
RUN cd /var/www/html/ts3web/ && composer install
|
RUN cd /var/www/html/application/ \
|
||||||
|
&& composer install
|
|
@ -2,7 +2,7 @@
|
||||||
server {
|
server {
|
||||||
listen 80 default_server;
|
listen 80 default_server;
|
||||||
|
|
||||||
root /var/www/html/ts3web/public;
|
root /var/www/html/application/public;
|
||||||
|
|
||||||
index index.html index.htm index.php;
|
index index.html index.htm index.php;
|
||||||
|
|
||||||
|
|
Reference in a new issue