S3 deployment

  • First create S3 folder in your home directory:
mkdir S3
  • Create 'docker-compose.yml' file:
version: '2'
services:
  web:
    image: registry.gitlab.com/metaphor/stratega-fm/fm-web:sgw-20171201
    ports:
     - "127.0.0.1:8080:8080"
    links:
     - frontend
     - backend
     - auth
     - lrm-user-guide
     - highcharts-export-server
  frontend:
    image: registry.gitlab.com/metaphor/stratega-fm/fm-frontend:sgw-20171201
    links:
     - backend
     - auth
  backend:
    image: registry.gitlab.com/metaphor/stratega-fm/fm-backend:sgw-20171201
    command: "-Dswarm.datasources.data-sources.S3DS.connection-url=jdbc:postgresql://db/${POSTGRES_DB} -Dswarm.datasources.data-sources.S3DS.user-name=${POSTGRES_USER} -Dswarm.datasources.data-sources.S3DS.password=${POSTGRES_PASSWORD} -DkeycloakServerUrl=http://auth:8180/auth -DkeycloakServerHost=${KEYCLOAK_SERVER_HOST} -DkeycloakServerProto=${KEYCLOAK_SERVER_PROTO} -DkeycloakRealm=${KEYCLOAK_REALM} -DkeycloakUsername=${KEYCLOAK_USER} -DkeycloakPassword=${KEYCLOAK_PASSWORD} -DkeycloakClientId=${KEYCLOAK_CLIENT_ID} -DkeycloakApplicationRealm=${KEYCLOAK_APPLICATION_REALM} -Djava.net.preferIPv4Stack=true"
    links:
     - db
     - auth
  db:
    image: postgres:9.5
    environment:
      POSTGRES_DB: '${POSTGRES_DB}'
      POSTGRES_USER: '${POSTGRES_USER}'
      POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}'
    volumes:
      - "./volumes/db:/var/lib/postgresql/data:z"
  auth:
    image: registry.gitlab.com/metaphor/stratega-fm/fm-auth:sgw-20171201
    environment:
      KEYCLOAK_USER: '${KEYCLOAK_USER}'
      KEYCLOAK_PASSWORD: '${KEYCLOAK_PASSWORD}'
      POSTGRES_DATABASE: '${KEYCLOAK_POSTGRES_DB}'
      POSTGRES_USER: '${KEYCLOAK_POSTGRES_USER}'
      POSTGRES_PASSWORD: '${KEYCLOAK_POSTGRES_PASSWORD}'
      POSTGRES_PORT_5432_TCP_ADDR: 'auth-db'
      JAVA_OPTS: '-Djboss.socket.binding.port-offset=100 -Djava.net.preferIPv4Stack=true'
    command: -b 0.0.0.0 -Dkeycloak.import=/opt/jboss/fm.json
    links:
     - auth-db
  auth-db:
    image: postgres:9.5
    environment:
      POSTGRES_DB: '${KEYCLOAK_POSTGRES_DB}'
      POSTGRES_USER: '${KEYCLOAK_POSTGRES_USER}'
      POSTGRES_PASSWORD: '${KEYCLOAK_POSTGRES_PASSWORD}'
    volumes:
      - "./volumes/auth-db:/var/lib/postgresql/data:z"
  lrm-user-guide:
    image: registry.gitlab.com/metaphor/stratega-fm/fm-lrm-user-guide:sgw-20171201
  highcharts-export-server:
    image: registry.gitlab.com/metaphor/stratega-fm/fm-highcharts-export-server:sgw-20171201
  • Create '.env file':
KEYCLOAK_REALM=master
KEYCLOAK_USER=admin
KEYCLOAK_PASSWORD=<another_password_1>
KEYCLOAK_CLIENT_ID=admin-cli
KEYCLOAK_APPLICATION_REALM=S3

KEYCLOAK_SERVER_HOST=<your_domain_name>
KEYCLOAK_SERVER_PROTO=https

KEYCLOAK_POSTGRES_DB=keycloak
KEYCLOAK_POSTGRES_USER=keycloak
KEYCLOAK_POSTGRES_PASSWORD=<another_password_2>

POSTGRES_DB=S3
POSTGRES_USER=postgres
POSTGRES_PASSWORD=<another_password_3>
  • Login to Gitlab Registry:
docker login registry.gitlab.com

Username: **************
Password: **************
Login Succeeded
  • Start first time databases initialization (run once):
docker-compose up -d db auth-db
  • To see logs run 'docker-compose logs'. You should get this output:
docker-compose logs

Starting s3_db_1 ...
Starting s3_auth-db_1 ...
Starting s3_db_1
Starting s3_db_1 ... done
Attaching to s3_auth-db_1, s3_db_1
auth-db_1                   | The files belonging to this database system will be owned by user "postgres".
auth-db_1                   | This user must also own the server process.
auth-db_1                   |
auth-db_1                   | The database cluster will be initialized with locale "en_US.utf8".
...
...
...
auth-db_1                   | PostgreSQL init process complete; ready for start up.
auth-db_1                   |
auth-db_1                   | LOG:  database system was shut down at 2017-12-02 09:03:30 UTC
auth-db_1                   | LOG:  MultiXact member wraparound protections are now enabled
auth-db_1                   | LOG:  autovacuum launcher started
auth-db_1                   | LOG:  database system is ready to accept connections
auth-db_1                   | LOG:  received smart shutdown request
auth-db_1                   | LOG:  autovacuum launcher shutting down
auth-db_1                   | LOG:  shutting down
auth-db_1                   | LOG:  database system is shut down
  • Then start Compose in background:
docker-compose up -d

Pulling highcharts-export-server (registry.gitlab.com/metaphor/stratega-fm/fm-highcharts-export-server:sgw-20171201)...
Trying to pull repository registry.gitlab.com/metaphor/stratega-fm/fm-highcharts-export-server ...
sgw-20171201: Pulling from registry.gitlab.com/metaphor/stratega-fm/fm-highcharts-export-server
be666fb3dd35: Pull complete
83be8b767650: Pull complete
881a76cd4924: Pull complete
984e4aef83ee: Pull complete
9ac4c8a58ddd: Pull complete
252f1f7248eb: Pull complete
...
...
...
Creating s3_auth-db_1 ... done
Creating s3_auth_1 ...
Creating s3_auth_1 ... done
Creating s3_backend_1 ...
Creating s3_backend_1 ... done
Creating s3_frontend_1 ...
Creating s3_frontend_1 ... done
Creating s3_web_1 ...
Creating s3_web_1 ... done
  • To verify that S3 is accessible visit your server's public IP address in your web browser:
https://server_domain_name/
  • If you have an external firewall configured to block all outbound traffic in your corporate network, then you need to open this ports:

    • 465 (SMTP)
    • 80 (HTTP)
    • 443 (HTTPS)

    It is necessary for S3 sending emails and making API requests.

results matching ""

    No results matching ""