Giter Site home page Giter Site logo

xmarcosx / ed-fi-ods-docker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ed-fi-alliance-oss/ed-fi-ods-docker

0.0 2.0 0.0 1.71 MB

This repository hosts the docker deployment source code for ODS/API

License: Apache License 2.0

Dockerfile 42.91% Shell 32.97% PowerShell 11.68% Mustache 12.44%

ed-fi-ods-docker's Introduction

Ed-Fi-ODS-Docker

This repository hosts the Docker deployment source code for ODS/API. To work with what is offered in this repository, set up your Docker environment by referring to Setup Your Docker Environment.

Docker Compose

Docker Compose is a tool for defining and running multi-container Docker applications. This repository includes two compose files for running the ODS/API behind a proxy.

An example how to use run the compose files by running the following command: docker-compose -f .\Compose\pgsql\compose-sandbox-env.yml --env-file .\.env up -d.

Provides an implementation of a sandbox environment with the ODS/API, Sandbox Admin, and SwaggerUI behind nginx. The databases EdFi_Admin and EdFi_Security are installed on one instance of PostgreSQL 11. The EdFi_Ods sandboxes and templates are installed on a separate instance of PostgreSQL 11.

Provides an implementation of a shared instance environment of the ODS/API and Admin App behind nginx. The databases EdFi_Admin and EdFi_Security are installed on one instance of PostgreSQL 11. The EdFi_Ods database and minimal template are installed on a separate instance of PostgreSQL 11.

While these compose files pull down the images from Docker Hub, there are two additional compose files compose-sandbox-env-build.yml and compose-shared-instance-env-build.yml included in the repository for working with the Dockerfile directly for customizations.

The repository also includes setup (e.g. sandbox-env-up.ps1) and teardown (e.g. sandbox-env-clean.ps1) PowerShell scripts that you can refer to see how to use these compose files.

Exposed Ports

The compose files expose the databases outside of the Docker network. To disable this, modify the compose file by removing the ports key for the databases. For example:

db:
    build:
      context: ./DB-Sandbox
      dockerfile: Dockerfile
    environment:
      POSTGRES_USER: "${POSTGRES_USER}"
      POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
    ports:
      - "5401:5432"
    volumes:
      -  vol-db-sandbox:/var/lib/postgresql/data
    restart: always
    container_name: ed-fi-db-sandbox

would be changed to:

db:
    build:
      context: ./DB-Sandbox
      dockerfile: Dockerfile
    environment:
      POSTGRES_USER: "${POSTGRES_USER}"
      POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
    volumes:
      -  vol-db-sandbox:/var/lib/postgresql/data
    restart: always
    container_name: ed-fi-db-sandbox

For the ODS/API, Admin App, Swagger and Sandbox Admin tool, the ports need to be exposed to support the proxy server, as virtual path support is not available at this time. This will be addressed in a future release.

Logging

The ODS/API, Admin App and Sandbox Admin have been set up to write logs to a mounted folder within their Docker containers. By setting the environment variable LOGS_FOLDER to a path (e.g. c:/tmp/logs for windows hosts or ~/tmp/logs for Linux/MacOs hosts) you can configure the log files to be placed there.

.env File

Compose supports declaring default environment variables in an environment file named .env, placed in the folder where the docker-compose command is executed (current working directory). Following command can be used with docker-compose to use an environment file with different name or location.

docker-compose --env-file .env.dev -f (docker-compose-filename) up

Supported environment variables

.env.example file included in the repository lists the supported environment variables.

Self-Signed Certificate

The deployments require valid SSL certificate to function. A self-signed certificate can be used for a Non-Production environment. This repository includes generate-cert.sh script that can be used to generate a self-signed certificate and place it in folder ./ssl to be used by the running Gateway container.

If deploying on local Windows host, you will either need GitBash or WSL to run generate-cert.sh.

Using GitBash

  • Start a GitBash Session

  • Run the following commands:

    export MSYS_NO_PATHCONV=1
    ./generate-cert.sh

Using WSL

PgBouncer

This compose files use [https://www.pgbouncer.org/|PGBouncer] to manage the connection pools for the database as PostgreSQL does not manage connections. Without this management the database runs out of connections and requires a reboot. There are other solutions available or if the implementor would like to remove this dependency the following needs to be changed.

  1. Remove and/or comment out the pb-admin and pb-ods services from the compose file.
  2. Update admin, and api services and change the database environment variables (ODS_POSTGRES_HOST, and ADMIN_POSTGRES_HOST) to point to db-ods and db-admin from pb-ods and pb-admin.
  3. Update the POSTGRES_PORT environment variable to point to 5432.
  4. If required expose the port on the services db-admin, and db-ods services. Note these ports should be independent.

Contributing

The Ed-Fi Alliance welcomes code contributions from the community. For more information, see:

Legal Information

Copyright (c) 2020 Ed-Fi Alliance, LLC and contributors.

Licensed under the Apache License, Version 2.0 (the "License").

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

See NOTICES for additional copyright and license notifications.

ed-fi-ods-docker's People

Contributors

jamessmckay avatar csr2017 avatar saa14 avatar ptar-innive avatar tnunnerydl avatar axelmarquez avatar stephenfuqua avatar raghuramakrishna avatar vimayya avatar tmeador-dl avatar bptillman avatar smundheinnive avatar andonyns avatar dalluinniveinc avatar semalaiappan avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.