Skip to content

Commit

Permalink
Merge pull request #711 from City-of-Helsinki/UHF-9099
Browse files Browse the repository at this point in the history
UHF-9099: Artemis service, moved elasticsearch to docker-compose.yml, added search and queue compose profiles
  • Loading branch information
tuutti authored Oct 6, 2023
2 parents 7c2511f + 44a4f4e commit 09fa869
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 67 deletions.
8 changes: 3 additions & 5 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
COMPOSE_PROJECT_NAME=helfi-kymp
PROJECT_NAME=liikenne

# Default Docker compose profiles
COMPOSE_PROFILES=search,queue

# OpenShift project name
OC_PROJECT_NAME=hki-kanslia-liikenne-test

Expand All @@ -20,12 +23,7 @@ SITE_PREFIX="/kaupunkiymparisto-ja-liikenne"
# Docker image
DRUPAL_IMAGE=ghcr.io/city-of-helsinki/drupal-web:8.2

# Default source @alias where to sync database and files from
DRUPAL_SYNC_SOURCE=main

# Public webroot
DRUPAL_WEBROOT=public

DRUPAL_SYNC_FILES=no

ELASTIC_PROXY_URL=https://elastic-helfi-kymp.docker.so
29 changes: 12 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
# City of Helsinki - KYMP Drupal 9
# City of Helsinki - Liikenne Drupal

## Environments

Env | Branch | Drush alias | URL
--- | ------ | ----------- | ---
development | * | - | http://helfi-kymp.docker.so/
production | main | @main | TBD
Env | Branch | URL
--- |--------| ---
local | dev | http://helfi-kymp.docker.so/
production | main | TBD

## Requirements

You need to have these applications installed to operate on all environments:

- [Docker](https://github.com/druidfi/guidelines/blob/master/docs/docker.md)
- [Stonehenge](https://github.com/druidfi/stonehenge)
- For the new person: Your SSH public key needs to be added to servers

## Create and start the environment

For the first time (new project):
To install Drupal from scratch using existing configuration:

``
$ make new
``

And following times to create and start the environment:
To sync database from testing environment:

``
$ make fresh
``

NOTE: Change these according of the state of your project.

## Login to Drupal container

This will log you inside the app container:
Expand All @@ -39,12 +36,10 @@ This will log you inside the app container:
$ make shell
```

## Testing

Start your containers with `COMPOSE_PROFILES=testing make up` or add
## Docker compose profiles

```
COMPOSE_PROFILES=testing
```
Modify the value of `COMPOSE_PROFILES` environment variable from `.env` file or start the project with `COMPOSE_RROFILES=your-profiles make up`.

to your `.env` file and restart all containers (`make stop && make up`).
### Available profiles:
- `search`
- `queue`
5 changes: 0 additions & 5 deletions docker-compose.ci.yml

This file was deleted.

38 changes: 0 additions & 38 deletions docker-compose.override.yml

This file was deleted.

52 changes: 50 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ services:
STAGE_FILE_PROXY_ORIGIN: "${STAGE_FILE_PROXY_ORIGIN}"
STAGE_FILE_PROXY_ORIGIN_DIR: "${STAGE_FILE_PROXY_ORIGIN_DIR}"
APP_ENV: "${APP_ENV:-local}"
ELASTIC_PROXY_URL: ${ELASTIC_PROXY_URL}
DRUPAL_ROUTES: "https://varnish-${DRUPAL_HOSTNAME},https://helfi-proxy.docker.so,http://${COMPOSE_PROJECT_NAME}-varnish"
DRUPAL_REVERSE_PROXY_ADDRESS: helfi-proxy.docker.so
DRUSH_OPTIONS_URI: "https://${DRUPAL_HOSTNAME}"
Expand All @@ -21,8 +22,8 @@ services:
# xdebug by default (like /etc/environments, ~/.bashrc, or ~/.zshrc).
XDEBUG_ENABLE: "${XDEBUG_ENABLE:-false}"
# DOCKERHOST: host.docker.internal
# Use drush server to run functional tests so we don't have to care about
# permission issues.
# Use drush server to run functional tests, so we don't have to care about
# permission or SSL issues.
SIMPLETEST_BASE_URL: "http://127.0.0.1:8888"
SIMPLETEST_DB: "mysql://drupal:drupal@db:3306/drupal"
BROWSERTEST_OUTPUT_BASE_URL: "https://${DRUPAL_HOSTNAME}"
Expand Down Expand Up @@ -82,6 +83,53 @@ services:
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-varnish.tls=true"
- "traefik.http.services.${COMPOSE_PROJECT_NAME}-varnish.loadbalancer.server.port=6081"
- "traefik.docker.network=stonehenge-network"
elastic:
image: docker.elastic.co/elasticsearch/elasticsearch:8.4.0
container_name: "${COMPOSE_PROJECT_NAME}-elastic"
environment:
- node.name="${COMPOSE_PROJECT_NAME}-elastic"
- discovery.seed_hosts=elastic
- cluster.name=es-docker-cluster
- cluster.initial_master_nodes="${COMPOSE_PROJECT_NAME}-elastic"
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "http.cors.allow-origin=\"*\""
- "http.cors.enabled=true"
- "http.cors.allow-headers=X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization"
- "http.cors.allow-credentials=true"
- xpack.security.enabled=false
ulimits:
memlock:
soft: -1
hard: -1
ports:
- 9200-9220:9200
networks:
- internal
- stonehenge-network
labels:
- "traefik.enable=true"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-elastic.entrypoints=https"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-elastic.rule=Host(`elastic-${DRUPAL_HOSTNAME}`)"
- "traefik.http.routers.${COMPOSE_PROJECT_NAME}-elastic.tls=true"
- "traefik.http.services.${COMPOSE_PROJECT_NAME}-elastic.loadbalancer.server.port=9200"
- "traefik.docker.network=stonehenge-network"
- "traefik.port=9200"
profiles:
- search
artemis:
container_name: "${COMPOSE_PROJECT_NAME}-artemis"
image: quay.io/artemiscloud/activemq-artemis-broker
ports:
- "8161:8161"
- "61616:61616"
- "5672:5672"
environment:
AMQ_EXTRA_ARGS: "--nio --user admin --password admin"
networks:
- internal
profiles:
- queue
networks:
internal:
external: false
Expand Down

0 comments on commit 09fa869

Please sign in to comment.