installing_avril
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| installing_avril [2021/08/18 18:41] – [Option 2: Create the container for avril application with ''docker run''] kalaschnikow | installing_avril [2023/04/29 08:28] (current) – [Install Certbot and Let's Encrypt Certificates] kalaschnikow | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Installing Avril ====== | ||
| + | |||
| + | ===== Create new user on the system (optional) ===== | ||
| + | If necessary create a new user: | ||
| + | <code bash> | ||
| + | adduser kalaschnikow | ||
| + | </ | ||
| + | |||
| + | And add this user to the sudoers group: | ||
| + | <code bash> | ||
| + | usermod -aG sudo kalaschnikow | ||
| + | </ | ||
| + | |||
| + | ===== Change SSH configuration (optional) ===== | ||
| + | Edit the '' | ||
| + | <code bash> | ||
| + | sudo nano / | ||
| + | </ | ||
| + | |||
| + | Change following options in it: | ||
| + | <code bash> | ||
| + | Port 1002 | ||
| + | PermitRootLogin no | ||
| + | AllowUsers kalaschnikow | ||
| + | </ | ||
| + | |||
| + | To apply the new settings reload the SSH service: | ||
| + | |||
| + | <code bash> | ||
| + | sudo service ssh reload | ||
| + | </ | ||
| + | |||
| + | |||
| + | More about SSH hardening: https:// | ||
| + | |||
| + | ===== Install Docker CE ===== | ||
| + | |||
| + | https:// | ||
| + | |||
| + | After that install docker-compose: | ||
| + | |||
| + | ===== Create all necessary directories ===== | ||
| + | |||
| + | After that create directories for our installation: | ||
| + | <code bash> | ||
| + | sudo mkdir -p / | ||
| + | sudo mkdir -p / | ||
| + | sudo mkdir -p / | ||
| + | sudo mkdir -p / | ||
| + | sudo mkdir -p / | ||
| + | sudo mkdir -p / | ||
| + | sudo mkdir -p / | ||
| + | sudo mkdir -p / | ||
| + | sudo mkdir -p / | ||
| + | |||
| + | # make dirs for volumes (see docker-compose.yml for all volumes): | ||
| + | # | ||
| + | # keycloakmysql service | ||
| + | sudo mkdir -p / | ||
| + | |||
| + | # avrilkeycloak service | ||
| + | sudo mkdir -p / | ||
| + | |||
| + | # avrilmysql service | ||
| + | sudo mkdir -p / | ||
| + | |||
| + | # avril service | ||
| + | sudo mkdir -p / | ||
| + | sudo mkdir -p / | ||
| + | sudo mkdir -p / | ||
| + | sudo mkdir -p / | ||
| + | sudo mkdir -p / | ||
| + | sudo mkdir -p / | ||
| + | sudo mkdir -p / | ||
| + | |||
| + | # avriljrserver service | ||
| + | sudo mkdir -p / | ||
| + | sudo mkdir -p / | ||
| + | |||
| + | # avrilrabbitmq service | ||
| + | sudo mkdir -p / | ||
| + | |||
| + | # avrilnginx service | ||
| + | sudo mkdir -p / | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | Or all-in-one command -> make all directories (except of volumes): | ||
| + | <code bash> | ||
| + | mkdir /dockerdata && mkdir / | ||
| + | mkdir / | ||
| + | mkdir / | ||
| + | mkdir / | ||
| + | mkdir / | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Move MySQL Databases ===== | ||
| + | |||
| + | Move databases (zipped previously on the source system) to the new server with: | ||
| + | |||
| + | <code bash> | ||
| + | # on the old server | ||
| + | cd / | ||
| + | sudo zip -r keycloakmysql.zip keycloakmysql | ||
| + | sudo zip -r avrilmysql.zip avrilmysql | ||
| + | # then copy zip files to the target system | ||
| + | scp -P1002 *.zip kalaschnikow@avril2021.avril.work:/ | ||
| + | </ | ||
| + | |||
| + | After that (on the new server): | ||
| + | |||
| + | <code bash> | ||
| + | mv ~/ | ||
| + | cd / | ||
| + | unzip avrilmysql.zip | ||
| + | unzip keycloakmysql.zip | ||
| + | # move the inflated directories to / | ||
| + | mv avrilmysql ../volumes | ||
| + | mv keycloakmysql ../volumes | ||
| + | cd ../volumes | ||
| + | chmod -R a+w keycloakmysql | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Create user-defined network ===== | ||
| + | |||
| + | Create user-defined network '' | ||
| + | |||
| + | <code bash> | ||
| + | sudo docker network create avrilnet | ||
| + | </ | ||
| + | |||
| + | ===== Create container for keycloak database ===== | ||
| + | At first create the container for the keycloak database. The best option is to create it with docker-compose. So simply add the following service to the '' | ||
| + | < | ||
| + | keycloakmysql: | ||
| + | image: mysql:5.5 | ||
| + | environment: | ||
| + | - MYSQL_DATABASE=keycloak | ||
| + | - MYSQL_USER=keycloak | ||
| + | - MYSQL_PASSWORD=keycYaopnlp=8 | ||
| + | - MYSQL_ROOT_PASSWORD=mysqlYaopnlp=8 | ||
| + | ports: | ||
| + | - " | ||
| + | volumes: | ||
| + | - / | ||
| + | networks: | ||
| + | default: | ||
| + | aliases: | ||
| + | - keycloakmysql | ||
| + | # | ||
| + | # To deploy in docker swarm instead of ' | ||
| + | # | ||
| + | # deploy: | ||
| + | # restart_policy: | ||
| + | # condition: on-failure | ||
| + | # delay: 5s | ||
| + | # max_attempts: | ||
| + | restart: on-failure | ||
| + | </ | ||
| + | |||
| + | Another option is to create the container with '' | ||
| + | <code bash> | ||
| + | sudo docker run --network avrilnet -p 3307:3306 \ | ||
| + | --name keycloakmysql -v / | ||
| + | -e MYSQL_DATABASE=keycloak -e MYSQL_USER=keycloak -e MYSQL_PASSWORD=keycYaopnlp=8 \ | ||
| + | -e MYSQL_ROOT_PASSWORD=mysqlYaopnlp=8 -d mysql:5.5 | ||
| + | </ | ||
| + | |||
| + | ===== Create container for keycloak (move it from old server) ===== | ||
| + | |||
| + | <code bash> | ||
| + | # | ||
| + | # ### On SRC server ### | ||
| + | # | ||
| + | |||
| + | # pack AvrilKeycloak image | ||
| + | sudo docker save -o ./ | ||
| + | |||
| + | # copy file to the DEST server | ||
| + | scp AvrilKeycloak.tar -P1002 kalaschnikow@avril2021.avril.work:/ | ||
| + | |||
| + | |||
| + | # | ||
| + | # ### On DEST server ### | ||
| + | # | ||
| + | |||
| + | # copy file to _artifacts folder | ||
| + | cd / | ||
| + | mv ~/ | ||
| + | |||
| + | |||
| + | # load AvrilKeycloak image | ||
| + | sudo docker load -i AvrilKeycloak.tar | ||
| + | |||
| + | </ | ||
| + | |||
| + | Then copy '' | ||
| + | <code bash> | ||
| + | cd / | ||
| + | scp -P1002 stand* | ||
| + | # on the new server: | ||
| + | cd / | ||
| + | cp ~/ | ||
| + | </ | ||
| + | |||
| + | After that start the compose: | ||
| + | <code bash> | ||
| + | cd / | ||
| + | sudo docker-compose up -d | ||
| + | </ | ||
| + | |||
| + | Now we should have two services running: '' | ||
| + | ===== Create a NEW container for keycloak (unfortunately it does not work 100%) ===== | ||
| + | |||
| + | **Caution**: | ||
| + | |||
| + | Under ''/ | ||
| + | < | ||
| + | FROM jboss/ | ||
| + | |||
| + | COPY standalone.xml / | ||
| + | COPY standalone-ha.xml / | ||
| + | |||
| + | #USER jboss | ||
| + | #RUN sed -i -e ' | ||
| + | #RUN sed -i -e ' | ||
| + | |||
| + | |||
| + | CMD [" | ||
| + | </ | ||
| + | |||
| + | Old content of '' | ||
| + | |||
| + | < | ||
| + | |||
| + | FROM jboss/ | ||
| + | |||
| + | CMD [" | ||
| + | |||
| + | </ | ||
| + | |||
| + | Copy ''/ | ||
| + | |||
| + | <code bash> | ||
| + | cd / | ||
| + | scp -P1002 standalone*.xml | ||
| + | # then on the new server: | ||
| + | cd / | ||
| + | sudo mv ~/ | ||
| + | sudo mv ~/ | ||
| + | sudo mv ~/ | ||
| + | </ | ||
| + | |||
| + | ==== Build the image for keycloak server ==== | ||
| + | Build the image for keycloak server: | ||
| + | <code bash> | ||
| + | cd / | ||
| + | sudo docker image build --tag avrilkeycloak . | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Option 1: Create a container for keycloak server with '' | ||
| + | |||
| + | Add following service to '' | ||
| + | < | ||
| + | avrilkeycloak: | ||
| + | image: avrilkeycloak | ||
| + | environment: | ||
| + | - DB_VENDOR=mysql | ||
| + | - DB_ADDR=keycloakmysql | ||
| + | - MYSQL_PORT_3306_TCP_ADDR=keycloakmysql | ||
| + | - MYSQL_PORT_3306_TCP_PORT=3307 | ||
| + | - MYSQL_PASSWORD=keycYaopnlp=8 | ||
| + | - PROXY_ADDRESS_FORWARDING=true | ||
| + | ports: | ||
| + | - " | ||
| + | volumes: | ||
| + | - / | ||
| + | depends_on: | ||
| + | - keycloakmysql | ||
| + | networks: | ||
| + | default: | ||
| + | aliases: | ||
| + | - avrilkeycloak | ||
| + | restart: on-failure | ||
| + | </ | ||
| + | |||
| + | Then copy '' | ||
| + | <code bash> | ||
| + | cd / | ||
| + | scp -P1002 stand* | ||
| + | # on the new server: | ||
| + | cd / | ||
| + | cp ~/ | ||
| + | </ | ||
| + | |||
| + | After that start the compose: | ||
| + | <code bash> | ||
| + | cd / | ||
| + | sudo docker-compose up -d | ||
| + | </ | ||
| + | |||
| + | Now we should have two services running: '' | ||
| + | |||
| + | ==== Option 2: Create a container for keycloak server with '' | ||
| + | |||
| + | Create a container for keycloak server and run it: | ||
| + | <code bash> | ||
| + | sudo docker image build --tag avrilkeycloak . | ||
| + | |||
| + | sudo docker run --network avrilnet --name avrilkeycloak -p 8180: | ||
| + | </ | ||
| + | |||
| + | Now the containers can be started: '' | ||
| + | |||
| + | If necessary: open the Keycloak admin console, go to " | ||
| + | * avril-web | ||
| + | * security-admin-console | ||
| + | |||
| + | |||
| + | |||
| + | ===== Create container for nginx ===== | ||
| + | |||
| + | At first move all necesary config files from old server to the new | ||
| + | |||
| + | <code bash> | ||
| + | cd / | ||
| + | scp -P1002 *.conf | ||
| + | # then on the new server: | ||
| + | mv ~/*.conf . | ||
| + | </ | ||
| + | |||
| + | Then open the file '' | ||
| + | < | ||
| + | ... | ||
| + | </ | ||
| + | |||
| + | Also change lines: | ||
| + | < | ||
| + | ssl_certificate | ||
| + | ssl_certificate_key | ||
| + | # ssl_trusted_certificate | ||
| + | </ | ||
| + | |||
| + | ==== Get certificates using certbot ==== | ||
| + | |||
| + | Get Let's Encrypt certificates using certbot: | ||
| + | <code bash> | ||
| + | sudo certbot certonly --standalone -d avril2021.avril.work --email info@avril.work -n --agree-tos --expand | ||
| + | </ | ||
| + | |||
| + | (maybe the better way would be to get certificates not with '' | ||
| + | |||
| + | After that don't forget to renew the certificates before they expire (see [[Avril and Let's Encrypt Certificates]])! So either set an appointment in Google Calendar or (better) troubleshoot the renewing ('' | ||
| + | |||
| + | |||
| + | ==== Option 1: Create the container with docker-compose ==== | ||
| + | |||
| + | The best option is to create it with docker-compose. So simply add the following service to the '' | ||
| + | < | ||
| + | avrilnginx: | ||
| + | image: nginx: | ||
| + | ports: | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | volumes: | ||
| + | - / | ||
| + | - / | ||
| + | - / | ||
| + | - / | ||
| + | restart: on-failure | ||
| + | </ | ||
| + | |||
| + | ==== Option 2: Create the container with docker-run ==== | ||
| + | Another option is to create the container with '' | ||
| + | <code bash> | ||
| + | # not yet documented... | ||
| + | # something like: | ||
| + | # sudo docker run --network avrilnet -p 3307:3306 \ | ||
| + | # --name avrilnginx -v ... -d nginx | ||
| + | </ | ||
| + | |||
| + | ===== Create containers for avril database ===== | ||
| + | |||
| + | ==== Option 1: Create container with docker-compose ==== | ||
| + | Add the following service to the ''/ | ||
| + | < | ||
| + | avrilmysql: | ||
| + | image: mysql:5.5 | ||
| + | environment: | ||
| + | - MYSQL_DATABASE=avril | ||
| + | - MYSQL_USER=avril | ||
| + | - MYSQL_PASSWORD=avrilYaopnlp=8 | ||
| + | - MYSQL_ROOT_PASSWORD=mysqlYaopnlp=8 | ||
| + | ports: | ||
| + | - " | ||
| + | volumes: | ||
| + | - / | ||
| + | networks: | ||
| + | default: | ||
| + | aliases: | ||
| + | - avrilmysql | ||
| + | restart: on-failure | ||
| + | </ | ||
| + | |||
| + | Then start the compose: | ||
| + | <code bash> | ||
| + | cd / | ||
| + | |||
| + | # if necessary at first shutdown the compose | ||
| + | sudo docker-compose down | ||
| + | |||
| + | # then start it | ||
| + | sudo docker-compose up -d | ||
| + | </ | ||
| + | |||
| + | |||
| + | ==== Option 2: Create container with docker run ==== | ||
| + | |||
| + | (This way was not tested in august 2021.) | ||
| + | |||
| + | Create and run container for Avril application database | ||
| + | <code bash> | ||
| + | sudo docker run --network avrilnet -p 3306:3306 \ | ||
| + | --name avrilmysql -v / | ||
| + | -e MYSQL_DATABASE=avril -e MYSQL_USER=avril -e MYSQL_PASSWORD=avrilYaopnlp=8 \ | ||
| + | -e MYSQL_ROOT_PASSWORD=mysqlYaopnlp=8 -d mysql:5.5 | ||
| + | </ | ||
| + | |||
| + | ===== Create container for avril application ===== | ||
| + | |||
| + | Under ''/ | ||
| + | <code docker> | ||
| + | FROM jboss/ | ||
| + | |||
| + | # no longer necessary because we use a volume to deploy war-files | ||
| + | # ADD AvrilDock-201712-SNAPSHOT.war / | ||
| + | # ADD AvrilWebAdmin-201712-SNAPSHOT.war / | ||
| + | |||
| + | |||
| + | ADD standalone-custom.xml / | ||
| + | |||
| + | EXPOSE 9990 | ||
| + | |||
| + | EXPOSE 8787 | ||
| + | |||
| + | #RUN / | ||
| + | #CMD ["/ | ||
| + | |||
| + | CMD ["/ | ||
| + | |||
| + | </ | ||
| + | |||
| + | Copy the content of the file '' | ||
| + | |||
| + | <code bash> | ||
| + | scp -P1002 modules.zip standalone-custom.xml kalaschnikow@avril2021.avril.work:/ | ||
| + | |||
| + | scp -P1002 *.war modules.zip standalone-custom.xml kalaschnikow@avril2021.avril.work:/ | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | Then move *.war files to ''/ | ||
| + | <code bash> | ||
| + | mv / | ||
| + | </ | ||
| + | |||
| + | Then move '' | ||
| + | <code bash> | ||
| + | sudo mv / | ||
| + | </ | ||
| + | |||
| + | Move modules.zip to ''/ | ||
| + | <code bash> | ||
| + | sudo mv / | ||
| + | |||
| + | cd / | ||
| + | |||
| + | unzip modules.zip | ||
| + | </ | ||
| + | |||
| + | Move content of directory ''/ | ||
| + | <code bash> | ||
| + | # on the SRC system | ||
| + | cd / | ||
| + | scp -P1002 *.* kalaschnikow@avril2021.avril.work:/ | ||
| + | |||
| + | # on the DEST system | ||
| + | cd / | ||
| + | cp ~/ | ||
| + | cp ~/ | ||
| + | </ | ||
| + | |||
| + | |||
| + | After that build and run avril container: | ||
| + | <code bash> | ||
| + | cd / | ||
| + | |||
| + | sudo docker image build --tag avril . | ||
| + | </ | ||
| + | |||
| + | ==== Option 1: Create the container for avril application with '' | ||
| + | |||
| + | After that add the avril service to the ''/ | ||
| + | |||
| + | < | ||
| + | avril: | ||
| + | image: avril | ||
| + | environment: | ||
| + | - PROXY_ADDRESS_FORWARDING=true | ||
| + | - " | ||
| + | ports: | ||
| + | - " | ||
| + | - " | ||
| + | - " | ||
| + | volumes: | ||
| + | - / | ||
| + | - / | ||
| + | - / | ||
| + | - / | ||
| + | - / | ||
| + | - / | ||
| + | depends_on: | ||
| + | - avrilmysql | ||
| + | - avrilkeycloak | ||
| + | networks: | ||
| + | default: | ||
| + | aliases: | ||
| + | - avril | ||
| + | restart: on-failure | ||
| + | </ | ||
| + | |||
| + | Then restart the compose: | ||
| + | |||
| + | <code bash> | ||
| + | cd / | ||
| + | sudo docker-compose down | ||
| + | sudo docker-compose up -d | ||
| + | </ | ||
| + | |||
| + | ==== Option 2: Create the container for avril application with '' | ||
| + | |||
| + | It is also possible to run the container with '' | ||
| + | <code bash> | ||
| + | sudo docker run --network avrilnet --name avril --restart unless-stopped \ | ||
| + | -p 8080:8080 -p 9990:9990 -p 8787:8787 \ | ||
| + | -v / | ||
| + | -v / | ||
| + | -v / | ||
| + | -v / | ||
| + | -v / | ||
| + | -it avril | ||
| + | </ | ||
| + | |||
| + | ==== Test Avril installation ==== | ||
| + | |||
| + | |||
| + | To test the Avril installation open the following URL in browser: | ||
| + | < | ||
| + | |||
| + | If troubleshooting will be necessary, '' | ||
| + | <code bash> | ||
| + | sudo docker logs compose_avril_1 | ||
| + | </ | ||
| + | |||
| + | For more information about wildfly logs in docker see [[https:// | ||
| + | |||
| + | |||
| + | ===== Create container for rabbitmq image ===== | ||
| + | |||
| + | In ''/ | ||
| + | <code javascript> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | ], | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | } | ||
| + | ], | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | }, | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | ], | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | ], | ||
| + | " | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | ], | ||
| + | " | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | } | ||
| + | ], | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | In ''/ | ||
| + | < | ||
| + | FROM rabbitmq: | ||
| + | |||
| + | ADD definitions.json / | ||
| + | #ADD rabbitmq.config / | ||
| + | #RUN chown rabbitmq: | ||
| + | RUN chown rabbitmq: | ||
| + | |||
| + | # RUN rabbitmq-plugins enable --offline rabbitmq_management | ||
| + | RUN rabbitmq-plugins enable --offline rabbitmq_mqtt | ||
| + | |||
| + | EXPOSE 1883 15672 | ||
| + | |||
| + | CMD [" | ||
| + | </ | ||
| + | |||
| + | |||
| + | Now build a new image: | ||
| + | <code bash> | ||
| + | cd / | ||
| + | |||
| + | sudo docker image build --tag avrilrabbitmq . | ||
| + | </ | ||
| + | |||
| + | ==== Option 1: start the container with docker-compose ==== | ||
| + | Add the following code to the ''/ | ||
| + | < | ||
| + | avrilrabbitmq: | ||
| + | image: avrilrabbitmq | ||
| + | environment: | ||
| + | - ConnectionString=Server=sql.data; | ||
| + | expose: | ||
| + | - " | ||
| + | ports: | ||
| + | - " | ||
| + | - " | ||
| + | volumes: | ||
| + | - / | ||
| + | networks: | ||
| + | default: | ||
| + | aliases: | ||
| + | - avrilrabbitmq | ||
| + | restart: on-failure | ||
| + | </ | ||
| + | |||
| + | Then restart the compose: | ||
| + | |||
| + | <code bash> | ||
| + | cd / | ||
| + | sudo docker-compose down | ||
| + | sudo docker-compose up -d | ||
| + | </ | ||
| + | |||
| + | ==== Option 2: start the container with docker run ==== | ||
| + | |||
| + | The container can be run with (this option is not tested on '' | ||
| + | <code bash> | ||
| + | sudo docker run --network avrilnet \ | ||
| + | -d --hostname avril2021.avril.work --name avrilrabbitmq \ | ||
| + | -p 15672:15672 -p 1883:1883 \ | ||
| + | avrilrabbitmq | ||
| + | </ | ||
| + | Using IP for hostname (like '' | ||
| + | |||
| + | |||
| + | ===== Create container for jrserver application ===== | ||
| + | |||
| + | |||
| + | |||
| + | ==== Create jrserver image ==== | ||
| + | |||
| + | (This description is unfortunately not complete. Some copies etc. are not yet described.) | ||
| + | |||
| + | From the local computer: | ||
| + | <code bash> | ||
| + | # cd to the install dir, where are all files | ||
| + | cd ~/ | ||
| + | |||
| + | # copy build.jar | ||
| + | scp -P1002 ./ | ||
| + | |||
| + | # if necessary copy the report(s) too | ||
| + | scp -P1002 ./ | ||
| + | </ | ||
| + | |||
| + | On the server: | ||
| + | <code bash> | ||
| + | cp ~/build.jar / | ||
| + | cd / | ||
| + | |||
| + | # make script executable | ||
| + | sudo chmod a+x builddockerimage.sh | ||
| + | |||
| + | # start script which will create our jrserver image(s) | ||
| + | sudo ./ | ||
| + | |||
| + | |||
| + | # copy reports to the volume | ||
| + | cd / | ||
| + | cp ~/*.jrxml . | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | ==== Option 1: start the container with docker-compose ==== | ||
| + | Add the following code to the ''/ | ||
| + | < | ||
| + | avriljrserver: | ||
| + | image: jrserver/ | ||
| + | # environment: | ||
| + | # - PROXY_ADDRESS_FORWARDING=true | ||
| + | # - " | ||
| + | ports: | ||
| + | - " | ||
| + | volumes: | ||
| + | - / | ||
| + | - / | ||
| + | depends_on: | ||
| + | - avrilmysql | ||
| + | - avrilkeycloak | ||
| + | networks: | ||
| + | default: | ||
| + | aliases: | ||
| + | - avriljrserver | ||
| + | restart: on-failure | ||
| + | </ | ||
| + | |||
| + | Then restart the compose: | ||
| + | |||
| + | <code bash> | ||
| + | cd / | ||
| + | sudo docker-compose down | ||
| + | sudo docker-compose up -d | ||
| + | </ | ||
| + | ==== Option 2: start the container with docker run ==== | ||
| + | |||
| + | The container can be run with (this option is **not tested** on '' | ||
| + | <code bash> | ||
| + | sudo docker run --network avrilnet \ | ||
| + | -d --hostname avril2021.avril.work --name avriljrserver \ | ||
| + | -p 8380:8380 \ | ||
| + | avriljrserver | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ---- | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ---- | ||
| + | |||
| + | |||
| + | |||
| + | ===== Create autostarting service for all containers ===== | ||
| + | |||
| + | |||
| + | |||
| + | ... | ||
| + | |||
| + | |||
| + | ===== Start all containers with docker compose===== | ||
| + | |||
| + | <code bash> | ||
| + | sudo mkdir / | ||
| + | chmod -R a+w / | ||
| + | cd / | ||
| + | |||
| + | nano docker-compose.yml | ||
| + | </ | ||
| + | |||
| + | Paste the content of '' | ||
| + | |||
| + | After that run the compose: | ||
| + | |||
| + | <code bash> | ||
| + | sudo docker-compose -f / | ||
| + | |||
| + | # OR in the directory where docker-compose.yml is: | ||
| + | sudo docker-compose up -d | ||
| + | |||
| + | # OR for debugging purposes in " | ||
| + | sudo docker-compose up | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== Install Certbot and Let's Encrypt Certificates ===== | ||
| + | ... | ||
| + | |||
| + | |||
