Skip to content

lores/scratch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 

Repository files navigation

intranet_docker

Create & deploy Docker images of Intranet to local or AWS environments.

Deploying code to AWS

  • git clone [email protected]:ministryofjustice/wp-cloudformation-templates --branch intranet
  • Build your Docker image (see Building an image)
  • Get the details of an Intranet database (see Creating a new DB if you need a new one)
  • Create/adapt an env file (see Creating env files) if you need a new one)
  • intranet-docker/bin/create_stack -t wp-cloudformation-templates/intranet/hosting.yaml -e ~/env/demo-shiny.env

This will create the CloudFormation stack demo-shiny and the code will run in the ECS demo cluster. You can watch the progress of the stack in the AWS web tools: CloudFormation for the progress of the stack, ECS for the container status, CloudWatch for container logs.

Building an image

  • Commit your code and push it to GitHub.
  • Edit intranet-docker/build/composer.json; set the versions in require to be what you want. For example, if you committed to ministryofjustice/intranet-clarity:feature-branch-foo, set
"ministryofjustice/intranet-theme-clarity":"dev-feature-branch-foo"
# load the bash functions
source intranet-docker/bash_aliases
# build the image
intbuild
# push the image to the AWS Docker repo
intpush

Deploying a new shared-infrastructure stack

  • git clone [email protected]:ministryofjustice/wp-cloudformation-templates --branch intranet
  • Create/adapt an env file (see Creating env files) if you need a new one)
  • Create/get name of ECS cluster to deploy in (see Creating a cluster if you need a new one)
  • intranet-docker/bin/create_stack -t wp-cloudformation-templates/intranet/shared_infrastructure.yaml -e ~/dev-shared.env

Updating an existing stack

This will update the stack's AWS infrastructure and deploy new Docker containers if the tag has changed. If the tag has not changed, see Redeploy a stack's Docker containers

  • git clone [email protected]:ministryofjustice/wp-cloudformation-templates --branch intranet
  • Create/adapt an env file (see Creating env files if you need a new one)
  • intranet-docker/update_stack -t wp-cloudformation-templates/intranet/[hosting,shared_infrastructure].yaml -e ~/env/myenv.env

##Creating env files Setup the contents of the env file to reflect your deployment target. For example, you want to deploy your new image mojintranet:shiny to the demo environment with URL https://shiny.demo.intranet.dsd.io, and use the database demo_shiny. Set the following options in e.g. ~/env/demo-shiny.env:

ACTIVE=true
SERVER_NAME=shiny.demo.intranet.dsd.io
ENVIRONMENT=demo
DOCKER_IMAGE=mojintranet:shiny
SHARED_STACK=mojintranet-demo-shared # name of AWS stack for the demo environment with the S3 bucket & other shared facilities
DB_NAME=demo_shiny
LOGIN_WHITELIST_IPS=81.134.202.29 # MoJ Digital network or VPC can login as admin
SITE_WHITELIST_IPS=81.134.202.29 # MoJ Digital network or VPC can access site

##Creating a new DB ##Enabling a new theme

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published