diff --git a/.gitignore b/.gitignore index f897ea313607..fe02c2ff3875 100644 --- a/.gitignore +++ b/.gitignore @@ -185,6 +185,8 @@ data-exports/ !/docker/.docker-data/artemis-data/.gitkeep /docker/.docker-data/artemis-mysql-data/* !/docker/.docker-data/artemis-mysql-data/.gitkeep +/docker/.docker-data/artemis-postgres-data/* +!/docker/.docker-data/artemis-postgres-data/.gitkeep ###################### # Cypress diff --git a/docker/.docker-data/artemis-postgres-data/.gitkeep b/docker/.docker-data/artemis-postgres-data/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/docker/artemis-dev-mysql.yml b/docker/artemis-dev-mysql.yml index 2e218cf60b7e..65655ef1b970 100644 --- a/docker/artemis-dev-mysql.yml +++ b/docker/artemis-dev-mysql.yml @@ -17,11 +17,8 @@ services: # expose the port to make it reachable docker internally even if the external port mapping changes expose: - "5005" - environment: - # The following enables the Java Remote Debugging port. More infos in the documentation: - # https://ls1intum.github.io/Artemis/dev/setup.html#debugging-with-docker - _JAVA_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 - SPRING_PROFILES_ACTIVE: artemis,scheduling,athena,dev,docker + env_file: + - ./artemis/config/dev.env depends_on: mysql: condition: service_healthy diff --git a/docker/artemis-dev-postgres.yml b/docker/artemis-dev-postgres.yml new file mode 100644 index 000000000000..5e1344511b6f --- /dev/null +++ b/docker/artemis-dev-postgres.yml @@ -0,0 +1,39 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Artemis-Dev-Postgres Setup +# ---------------------------------------------------------------------------------------------------------------------- + +services: + artemis-app: + extends: + file: ./artemis.yml + service: artemis-app + # just add this linux workaround for docker compose in a development version of artemis as developers + # might want to access external services on the docker host + extra_hosts: + - "host.docker.internal:host-gateway" + ports: + - "8080:8080" + - "5005:5005" # Java Remote Debugging port declared in the java cmd options + # expose the port to make it reachable docker internally even if the external port mapping changes + expose: + - "5005" + env_file: + - ./artemis/config/dev.env + - ./artemis/config/postgres.env + depends_on: + postgres: + condition: service_healthy + postgres: + extends: + file: ./postgres.yml + service: postgres + +networks: + artemis: + driver: "bridge" + name: artemis +volumes: + artemis-postgres-data: + name: artemis-postgres-data + artemis-data: + name: artemis-data diff --git a/docker/artemis-migration-check-postgres.yml b/docker/artemis-migration-check-postgres.yml index 2ddd82d07132..0d801be844d2 100644 --- a/docker/artemis-migration-check-postgres.yml +++ b/docker/artemis-migration-check-postgres.yml @@ -8,6 +8,8 @@ services: file: ./artemis.yml service: artemis-app env_file: + - ./artemis/config/postgres.env + - ./artemis/config/cypress.env - ./artemis/config/cypress-postgres.env - ./artemis/config/migration-check.env depends_on: @@ -32,7 +34,7 @@ networks: driver: "bridge" name: artemis volumes: - artemis-postgresql-data: - name: artemis-postgresql-data + artemis-postgres-data: + name: artemis-postgres-data artemis-data: name: artemis-data diff --git a/docker/artemis-prod-postgres.yml b/docker/artemis-prod-postgres.yml new file mode 100644 index 000000000000..fdb0c691f0ef --- /dev/null +++ b/docker/artemis-prod-postgres.yml @@ -0,0 +1,38 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Artemis-Prod-Postgres Setup +# ---------------------------------------------------------------------------------------------------------------------- + +services: + artemis-app: + extends: + file: ./artemis.yml + service: artemis-app + depends_on: + postgres: + condition: service_healthy + restart: on-failure:3 + volumes: + - ./.docker-data/artemis-data:/opt/artemis/data + env_file: + - ./artemis/config/postgres.env + postgres: + extends: + file: ./postgres.yml + service: postgres + restart: on-failure:3 + volumes: + - ./.docker-data/artemis-postgres-data:/var/lib/postgresql/data + nginx: + extends: + file: ./nginx.yml + service: nginx + # the artemis-app service needs to be started, otherwise there are problems with name resolution in docker + depends_on: + artemis-app: + condition: service_started + restart: on-failure:3 + +networks: + artemis: + driver: "bridge" + name: artemis diff --git a/docker/artemis/config/cypress-mysql.env b/docker/artemis/config/cypress-mysql.env index 17177a7afbf3..b9f006a4b395 100644 --- a/docker/artemis/config/cypress-mysql.env +++ b/docker/artemis/config/cypress-mysql.env @@ -1,34 +1,21 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Artemis configuration overrides for the Cypress E2E MySQL setups +# ---------------------------------------------------------------------------------------------------------------------- + SPRING_PROFILES_ACTIVE="artemis,scheduling,bamboo,bitbucket,jira,prod,docker" SPRING_DATASOURCE_URL="jdbc:mysql://artemis-mysql:3306/Artemis?createDatabaseIfNotExist=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC" SPRING_DATASOURCE_USERNAME="root" -SPRING_DATASOURCE_PASSWORD="" -SPRING_DATASOURCE_HIKARI_MAXIMUMPOOLSIZE="100" SPRING_JPA_DATABASE_PLATFORM="org.hibernate.dialect.MySQL8Dialect" SPRING_JPA_DATABASE="MYSQL" -SPRING_JPA_HIBERNATE_CONNECTION_CHARSET="utf8mb4" -SPRING_JPA_HIBERNATE_CONNECTION_CHARACTERENCODING="utf8mb4" -SPRING_JPA_HIBERNATE_CONNECTION_USEUNICODE="true" - -SPRING_PROMETHEUS_MONITORINGIP="131.159.89.160" - -# for bamboo and bitbucket notifications on /api/programming-exercises/new-result it seems like port -# 54321 is internally open for the bamboo agents -# also can't use SSL for this as the hostnames are not integrated in the self-signed certificate -SERVER_URL="http://${HOST_HOSTNAME}:54321" -# We don't need secure passwords for testing. Lower rounds will speed up tests. 4 is the lowest -ARTEMIS_BCRYPTSALTROUNDS="4" ARTEMIS_USERMANAGEMENT_USEEXTERNAL="true" ARTEMIS_USERMANAGEMENT_EXTERNAL_URL="https://jira-prelive.ase.in.tum.de" ARTEMIS_USERMANAGEMENT_EXTERNAL_USER="${bamboo_jira_prelive_admin_user}" ARTEMIS_USERMANAGEMENT_EXTERNAL_PASSWORD="${bamboo_jira_prelive_admin_password}" ARTEMIS_USERMANAGEMENT_EXTERNAL_ADMINGROUPNAME="artemis-dev" -ARTEMIS_USERMANAGEMENT_INTERNALADMIN_USERNAME="${bamboo_artemis_admin_username}" -ARTEMIS_USERMANAGEMENT_INTERNALADMIN_PASSWORD="${bamboo_artemis_admin_password}" -ARTEMIS_USERMANAGEMENT_LOGIN_ACCOUNTNAME="TUM" ARTEMIS_VERSIONCONTROL_URL="https://bitbucket-prelive.ase.in.tum.de" ARTEMIS_VERSIONCONTROL_USER="${bamboo_jira_prelive_admin_user}" @@ -40,22 +27,3 @@ ARTEMIS_CONTINUOUSINTEGRATION_PASSWORD="${bamboo_jira_prelive_admin_password}" ARTEMIS_CONTINUOUSINTEGRATION_TOKEN="${bamboo_ARTEMIS_CONTINUOUS_INTEGRATION_TOKEN_SECRET}" ARTEMIS_CONTINUOUSINTEGRATION_ARTEMISAUTHENTICATIONTOKENVALUE="${bamboo_ARTEMIS_CONTINUOUS_INTEGRATION_ARTEMIS_AUTHENTICATION_TOKEN_VALUE_SECRET}" ARTEMIS_CONTINUOUSINTEGRATION_VCSAPPLICATIONLINKNAME="Bitbucket Prelive" -ARTEMIS_CONTINUOUSINTEGRATION_EMPTYCOMMITNECESSARY="true" - -ARTEMIS_APOLLON_CONVERSIONSERVICEURL="https://apollon.ase.in.tum.de/api/converter" - -# Token is valid 3 days -JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDS="259200" -# Token is valid 30 days -JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDSFORREMEMBERME="2592000" - -# Properties to be exposed on the /info management endpoint - -INFO_IMPRINT="https://ase.in.tum.de/lehrstuhl_1/component/content/article/179-imprint" -INFO_TESTSERVER="true" -INFO_TEXTASSESSMENTANALYTICSENABLED="true" -INFO_STUDENTEXAMSTORESESSIONDATA="true" - -LOGGING_FILE_NAME="/opt/artemis/data/artemis.log" - -MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED="true" diff --git a/docker/artemis/config/cypress-postgres.env b/docker/artemis/config/cypress-postgres.env index d0ab68263c90..73254a9afebc 100644 --- a/docker/artemis/config/cypress-postgres.env +++ b/docker/artemis/config/cypress-postgres.env @@ -1,34 +1,10 @@ # ---------------------------------------------------------------------------------------------------------------------- -# Artemis configurations for Postgres setups +# Artemis configuration overrides for the Cypress E2E Postgres setups # ---------------------------------------------------------------------------------------------------------------------- SPRING_PROFILES_ACTIVE="artemis,scheduling,jenkins,gitlab,prod,docker" -SPRING_DATASOURCE_URL="jdbc:postgresql://artemis-postgresql:5432/Artemis?sslmode=disable" -SPRING_DATASOURCE_USERNAME="postgres" -SPRING_DATASOURCE_PASSWORD="" -SPRING_DATASOURCE_HIKARI_MAXIMUMPOOLSIZE="100" - -SPRING_JPA_DATABASE_PLATFORM="org.hibernate.dialect.PostgreSQL10Dialect" -SPRING_JPA_DATABASE="POSTGRESQL" -SPRING_JPA_HIBERNATE_CONNECTION_CHARSET="utf8mb4" -SPRING_JPA_HIBERNATE_CONNECTION_CHARACTERENCODING="utf8mb4" -SPRING_JPA_HIBERNATE_CONNECTION_USEUNICODE="true" - -SPRING_PROMETHEUS_MONITORINGIP="131.159.89.160" - -# for bamboo and bitbucket notifications on /api/programming-exercises/new-result it seems like port -# 54321 is internally open for the bamboo agents -# also can't use SSL for this as the hostnames are not integrated in the self-signed certificate -SERVER_URL="http://${HOST_HOSTNAME}:54321" - -# We don't need secure passwords for testing. Lower rounds will speed up tests. 4 is the lowest -ARTEMIS_BCRYPTSALTROUNDS="4" - ARTEMIS_USERMANAGEMENT_USEEXTERNAL="false" -ARTEMIS_USERMANAGEMENT_INTERNALADMIN_USERNAME="${bamboo_artemis_admin_username}" -ARTEMIS_USERMANAGEMENT_INTERNALADMIN_PASSWORD="${bamboo_artemis_admin_password}" -ARTEMIS_USERMANAGEMENT_LOGIN_ACCOUNTNAME="TUM" ARTEMIS_VERSIONCONTROL_URL="https://gitlab-test.artemis.in.tum.de" ARTEMIS_VERSIONCONTROL_USER="${bamboo_gitlab_admin_user}" @@ -44,26 +20,7 @@ ARTEMIS_CONTINUOUSINTEGRATION_SECRETPUSHTOKEN="${bamboo_jenkins_secret_push_toke ARTEMIS_CONTINUOUSINTEGRATION_VCSCREDENTIALS="${bamboo_jenkins_vcs_credentials_secret}" ARTEMIS_CONTINUOUSINTEGRATION_ARTEMISAUTHENTICATIONTOKENKEY="${bamboo_jenkins_artemis_ci_authentication_token_key_secret}" ARTEMIS_CONTINUOUSINTEGRATION_ARTEMISAUTHENTICATIONTOKENVALUE="${bamboo_jenkins_artemis_ci_authentication_token_value_secret}" -ARTEMIS_CONTINUOUSINTEGRATION_EMPTYCOMMITNECESSARY="true" ARTEMIS_CONTINUOUSINTEGRATION_BUILDTIMEOUT="30" -ARTEMIS_APOLLON_CONVERSIONSERVICEURL="https://apollon.ase.in.tum.de/api/converter" - -# Token is valid 3 days -JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDS="259200" -# Token is valid 30 days -JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDSFORREMEMBERME="2592000" - -# Properties to be exposed on the /info management endpoint - -INFO_IMPRINT="https://ase.in.tum.de/lehrstuhl_1/component/content/article/179-imprint" -INFO_TESTSERVER="true" -INFO_TEXTASSESSMENTANALYTICSENABLED="true" -INFO_STUDENTEXAMSTORESESSIONDATA="true" - -LOGGING_FILE_NAME="/opt/artemis/data/artemis.log" - -MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED="true" - JENKINS_INTERNALURLS_CIURL="https://jenkins-test.artemis.in.tum.de" JENKINS_INTERNALURLS_VCNURL="https://gitlab-test.artemis.in.tum.de" diff --git a/docker/artemis/config/cypress.env b/docker/artemis/config/cypress.env new file mode 100644 index 000000000000..c056a8d9004c --- /dev/null +++ b/docker/artemis/config/cypress.env @@ -0,0 +1,44 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Common Artemis configurations for the Cypress E2E MySQL and Postgres setups +# ---------------------------------------------------------------------------------------------------------------------- + +SPRING_DATASOURCE_PASSWORD="" +SPRING_DATASOURCE_HIKARI_MAXIMUMPOOLSIZE="100" + +SPRING_JPA_HIBERNATE_CONNECTION_CHARSET="utf8mb4" +SPRING_JPA_HIBERNATE_CONNECTION_CHARACTERENCODING="utf8mb4" +SPRING_JPA_HIBERNATE_CONNECTION_USEUNICODE="true" + +SPRING_PROMETHEUS_MONITORINGIP="131.159.89.160" + +# for bamboo and bitbucket notifications on /api/programming-exercises/new-result it seems like port +# 54321 is internally open for the bamboo agents +# also can't use SSL for this as the hostnames are not integrated in the self-signed certificate +SERVER_URL="http://${HOST_HOSTNAME}:54321" + +# We don't need secure passwords for testing. Lower rounds will speed up tests. 4 is the lowest +ARTEMIS_BCRYPTSALTROUNDS="4" + +ARTEMIS_USERMANAGEMENT_INTERNALADMIN_USERNAME="${bamboo_artemis_admin_username}" +ARTEMIS_USERMANAGEMENT_INTERNALADMIN_PASSWORD="${bamboo_artemis_admin_password}" +ARTEMIS_USERMANAGEMENT_LOGIN_ACCOUNTNAME="TUM" + +ARTEMIS_CONTINUOUSINTEGRATION_EMPTYCOMMITNECESSARY="true" + +ARTEMIS_APOLLON_CONVERSIONSERVICEURL="https://apollon.ase.in.tum.de/api/converter" + +# Token is valid 3 days +JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDS="259200" +# Token is valid 30 days +JHIPSTER_SECURITY_AUTHENTICATION_JWT_TOKENVALIDITYINSECONDSFORREMEMBERME="2592000" + +# Properties to be exposed on the /info management endpoint + +INFO_IMPRINT="https://ase.in.tum.de/lehrstuhl_1/component/content/article/179-imprint" +INFO_TESTSERVER="true" +INFO_TEXTASSESSMENTANALYTICSENABLED="true" +INFO_STUDENTEXAMSTORESESSIONDATA="true" + +LOGGING_FILE_NAME="/opt/artemis/data/artemis.log" + +MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED="true" diff --git a/docker/artemis/config/dev.env b/docker/artemis/config/dev.env new file mode 100644 index 000000000000..4dc4617261bd --- /dev/null +++ b/docker/artemis/config/dev.env @@ -0,0 +1,11 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Artemis configurations for Dev Artemis setups +# ---------------------------------------------------------------------------------------------------------------------- +# The default Artemis Spring profiles for Docker are defined here. +# ---------------------------------------------------------------------------------------------------------------------- + +SPRING_PROFILES_ACTIVE: artemis,scheduling,athena,dev,docker + +# The following enables the Java Remote Debugging port. More infos in the documentation: +# https://ls1intum.github.io/Artemis/dev/setup.html#debugging-with-docker +_JAVA_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 diff --git a/docker/artemis/config/postgres.env b/docker/artemis/config/postgres.env new file mode 100644 index 000000000000..2c8a07e95f37 --- /dev/null +++ b/docker/artemis/config/postgres.env @@ -0,0 +1,9 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Artemis configurations for Postgres setups +# ---------------------------------------------------------------------------------------------------------------------- + +SPRING_DATASOURCE_URL="jdbc:postgresql://artemis-postgres:5432/Artemis?sslmode=disable" +SPRING_DATASOURCE_USERNAME="postgres" + +SPRING_JPA_DATABASE_PLATFORM="org.hibernate.dialect.PostgreSQL10Dialect" +SPRING_JPA_DATABASE="POSTGRESQL" diff --git a/docker/artemis/config/prod.env b/docker/artemis/config/prod.env index 3f708bdc709e..a86a87bcf51a 100644 --- a/docker/artemis/config/prod.env +++ b/docker/artemis/config/prod.env @@ -1,6 +1,15 @@ +# ---------------------------------------------------------------------------------------------------------------------- +# Artemis configurations for Prod Artemis setups +# ---------------------------------------------------------------------------------------------------------------------- +# The default Artemis Spring profiles for Docker are defined here. +# ---------------------------------------------------------------------------------------------------------------------- SPRING_PROFILES_ACTIVE="artemis,scheduling,athena,prod,docker" +# ---------------------------------------------------------------------------------------------------------------------- # Secret Overrides +# ---------------------------------------------------------------------------------------------------------------------- +# Change these default secrets in another not-commited environment override file for prod systems! +# ---------------------------------------------------------------------------------------------------------------------- ARTEMIS_ATHENA_SECRET="abcdefg12345" ARTEMIS_USERMANAGEMENT_INTERNALADMIN_USERNAME="artemis_admin" ARTEMIS_USERMANAGEMENT_INTERNALADMIN_PASSWORD="artemis_admin" @@ -17,6 +26,10 @@ SPRING_WEBSOCKET_BROKER_PASSWORD="guest" JHIPSTER_SECURITY_AUTHENTICATION_JWT_BASE64SECRET="bXktc2VjcmV0LWtleS13aGljaC1zaG91bGQtYmUtY2hhbmdlZC1pbi1wcm9kdWN0aW9uLWFuZC1iZS1iYXNlNjQtZW5jb2RlZAo=" JHIPSTER_REGISTRY_PASSWORD="AN-ADMIN-PASSWORD-THAT-MUST-BE-CHANGED (FROM REGISTRY CONFIG)" - +# ---------------------------------------------------------------------------------------------------------------------- # Plain Prod Artemis Overrides +# ---------------------------------------------------------------------------------------------------------------------- +# Keep these at a minimum! Try to change the default values either in the application-docker.yml or even better +# in one of the other application.yml or application-*.yml files. +# ---------------------------------------------------------------------------------------------------------------------- ARTEMIS_USERMANAGEMENT_USEEXTERNAL="false" diff --git a/docker/cypress-E2E-tests-mysql.yml b/docker/cypress-E2E-tests-mysql.yml index 02a040a68dcd..99e96f8b7c87 100644 --- a/docker/cypress-E2E-tests-mysql.yml +++ b/docker/cypress-E2E-tests-mysql.yml @@ -16,6 +16,7 @@ services: mysql: condition: service_healthy env_file: + - ./artemis/config/cypress.env - ./artemis/config/cypress-mysql.env nginx: diff --git a/docker/cypress-E2E-tests-postgres.yml b/docker/cypress-E2E-tests-postgres.yml index e2396270d899..0c2ed641ee70 100644 --- a/docker/cypress-E2E-tests-postgres.yml +++ b/docker/cypress-E2E-tests-postgres.yml @@ -1,21 +1,23 @@ # ---------------------------------------------------------------------------------------------------------------------- -# Cypress Setup PostgreSQL +# Cypress Setup Postgres # ---------------------------------------------------------------------------------------------------------------------- services: - postgresql: + postgres: extends: - file: ./postgresql.yml - service: postgresql + file: ./postgres.yml + service: postgres artemis-app: extends: file: ./artemis.yml service: artemis-app depends_on: - postgresql: + postgres: condition: service_healthy env_file: + - ./artemis/config/postgres.env + - ./artemis/config/cypress.env - ./artemis/config/cypress-postgres.env nginx: @@ -51,7 +53,7 @@ networks: driver: "bridge" name: artemis volumes: - artemis-postgresql-data: - name: artemis-postgresql-data + artemis-postgres-data: + name: artemis-postgres-data artemis-data: name: artemis-data diff --git a/docker/mailhog.yml b/docker/mailhog.yml index 5145f67cdff4..70af79096071 100644 --- a/docker/mailhog.yml +++ b/docker/mailhog.yml @@ -7,7 +7,7 @@ services: mailhog: container_name: artemis-mailhog - image: mailhog/mailhog + image: docker.io/mailhog/mailhog pull_policy: always ports: - "1025:1025" diff --git a/docker/postgresql.yml b/docker/postgres.yml similarity index 64% rename from docker/postgresql.yml rename to docker/postgres.yml index aec7d23cfee7..097c9530baee 100644 --- a/docker/postgresql.yml +++ b/docker/postgres.yml @@ -3,19 +3,22 @@ # ---------------------------------------------------------------------------------------------------------------------- services: - postgresql: - container_name: artemis-postgresql - image: postgres:15.3-alpine + postgres: + container_name: artemis-postgres + image: docker.io/library/postgres:15.3-alpine pull_policy: always user: postgres command: ["postgres", "-c", "max_connections=200"] volumes: - - artemis-postgresql-data:/var/lib/postgresql/data + - artemis-postgres-data:/var/lib/postgresql/data # DO NOT use this default file for production systems! env_file: - - ./postgresql/default.env + - ./postgres/default.env ports: - - "5432:5432" + - "127.0.0.1:5432:5432" + # expose the port to make it reachable docker internally even if the external port mapping changes + expose: + - "5432" healthcheck: test: pg_isready -U postgres -d Artemis interval: 5s @@ -32,5 +35,5 @@ networks: name: artemis volumes: - artemis-postgresql-data: - name: artemis-postgresql-data + artemis-postgres-data: + name: artemis-postgres-data diff --git a/docker/postgresql/default.env b/docker/postgres/default.env similarity index 65% rename from docker/postgresql/default.env rename to docker/postgres/default.env index 9d69c3af68ff..d92a5b5f2722 100644 --- a/docker/postgresql/default.env +++ b/docker/postgres/default.env @@ -1,3 +1,4 @@ POSTGRES_HOST_AUTH_METHOD=trust POSTGRES_USER=postgres POSTGRES_DB=Artemis +PGDATA=/var/lib/postgresql/data/pgdata diff --git a/docker/test-server-postgresql.yml b/docker/test-server-postgresql.yml index 140d77a0cb3b..e9740206ed52 100644 --- a/docker/test-server-postgresql.yml +++ b/docker/test-server-postgresql.yml @@ -1,5 +1,5 @@ # ---------------------------------------------------------------------------------------------------------------------- -# Setup for a test server with PostgreSQL +# Setup for a test server with Postgres # ---------------------------------------------------------------------------------------------------------------------- # It is designed to take in a lot of environment variables to take in all the configuration of the test server. # ---------------------------------------------------------------------------------------------------------------------- @@ -11,7 +11,7 @@ services: service: artemis-app image: ghcr.io/ls1intum/artemis:${ARTEMIS_DOCKER_TAG:-latest} depends_on: - postgresql: + postgres: condition: service_healthy pull_policy: always restart: always @@ -22,15 +22,15 @@ services: - ${ARTEMIS_LEGAL_MOUNT:-./.docker-data/artemis-legal}:/opt/artemis/legal - ${ARTEMIS_DATA_EXPORT_MOUNT:-./.docker-data/artemis-data-exports}:/opt/artemis/data-exports - postgresql: + postgres: extends: - file: ./postgresql.yml - service: postgresql + file: ./postgres.yml + service: postgres restart: always env_file: - - ${DATABASE_ENV_FILE:-./postgresql/default.env} + - ${DATABASE_ENV_FILE:-./postgres/default.env} volumes: - - ${DATABASE_VOLUME_MOUNT:-./.docker-data/artemis-postgresql-data}:/var/lib/postgresql/data + - ${DATABASE_VOLUME_MOUNT:-./.docker-data/artemis-postgres-data}:/var/lib/postgresql/data nginx: extends: diff --git a/docs/admin/productionSetupTips.rst b/docs/admin/productionSetupTips.rst index fadaebb46766..cc95bee1b4ee 100644 --- a/docs/admin/productionSetupTips.rst +++ b/docs/admin/productionSetupTips.rst @@ -35,3 +35,24 @@ Place the webpage that should be shown in case of Artemis being unreachable (in error_page 501 502 503 /service_down.html; } + +## Gather all Docker Compose-related tips here which are not relevant for developers! +.. _docker_compose_setup_prod: + +Docker Compose Setup +-------------------- + +The :ref:`development section of the documentation ` provides a introduction to +Docker Compose setups for Artemis. +This section provides additional information for administrators. + +File Permissions +^^^^^^^^^^^^^^^^ +If you use the production Docker Compose Setups (``artemis-prod-*.yml``) with bind mounts change +the file permissions accordingly: + +.. code:: bash + + sudo chown -R $(id -u):70 docker/.docker-data/artemis-postgres-data + sudo chown -R $(id -u):999 docker/.docker-data/artemis-mysql-data + sudo chown -R $(id -u):1337 docker/.docker-data/artemis-data diff --git a/docs/dev/setup.rst b/docs/dev/setup.rst index 082a792a6be0..47d87eb8fa82 100644 --- a/docs/dev/setup.rst +++ b/docs/dev/setup.rst @@ -119,7 +119,8 @@ PostgreSQL Setup No special PostgreSQL settings are required. You can either use your package manager’s version, or set it up using a container. -An example Docker Compose setup based on the `official container image `_ is provided in ``src/main/docker/postgresql.yml``. +An example Docker Compose setup based on the `official container image `_ +is provided in ``src/main/docker/postgres.yml``. When setting up the Artemis server, the following values need to be added/updated in the server configuration (see setup steps below) to connect to PostgreSQL instead of MySQL: @@ -719,6 +720,8 @@ HTTP. We need to extend the configuration in the file ------------------------------------------------------------------------------------------------------------------------ +.. _docker_compose_setup_dev: + Alternative: Docker Compose Setup --------------------------------- @@ -765,7 +768,11 @@ The easiest way to configure a local deployment via Docker is a deployment with In the directory ``docker/`` you can find the following *docker compose* files for different **setups**: * ``artemis-dev-mysql.yml``: **Artemis-Dev-MySQL** Setup containing the development build of Artemis and a MySQL DB +* ``artemis-dev-postgres.yml``: **Artemis-Dev-Postgres** Setup containing the development build of Artemis and + a PostgreSQL DB * ``artemis-prod-mysql.yml``: **Artemis-Prod-MySQL** Setup containing the production build of Artemis and a MySQL DB +* ``artemis-prod-postgres.yml``: **Artemis-Prod-Postgres** Setup containing the production build of Artemis and + a PostgreSQL DB * ``atlassian.yml``: **Atlassian** Setup containing a Jira, Bitbucket and Bamboo instance (see `Bamboo, Bitbucket and Jira Setup Guide <#bamboo-bitbucket-and-jira-setup>`__ for the configuration of this setup) @@ -775,14 +782,15 @@ In the directory ``docker/`` you can find the following *docker compose* files f * ``monitoring.yml``: **Prometheus-Grafana** Setup containing a Prometheus and Grafana instance * ``mysql.yml``: **MySQL** Setup containing a MySQL DB instance * ``nginx.yml``: **Nginx** Setup containing a preconfigured Nginx instance -* ``postgresql.yml``: **PostgreSQL** Setup containing a PostgreSQL DB instance +* ``postgres.yml``: **Postgres** Setup containing a PostgreSQL DB instance -Two example commands to run such setups: +Three example commands to run such setups: .. code:: bash docker compose -f docker/atlassian.yml up docker compose -f docker/mysql.yml -f docker/gitlab-jenkins.yml up + docker compose -f docker/artemis-dev-postgres.yml up .. tip:: There is also a single ``docker-compose.yml`` in the directory ``docker/`` which mirrors the setup of ``artemis-prod-mysql.yml``. @@ -796,7 +804,7 @@ is defined in the following files: * ``artemis.yml``: **Artemis Service** * ``mysql.yml``: **MySQL DB Service** * ``nginx.yml``: **Nginx Service** -* ``postgresql.yml``: **PostgreSQL DB Service** +* ``postgres.yml``: **PostgreSQL DB Service** * ``gitlab.yml``: **GitLab Service** * ``jenkins.yml``: **Jenkins Service**