Giter Club home page Giter Club logo

alphagov.govuk-docker's Introduction

GOV.UK Docker

GOV.UK development environment using Docker.

diagram

The GOV.UK website uses a microservice architecture. Developing in this ecosystem is a challenge, due to the range of environments to maintain, both for the app being developed and its dependencies.

The aim of govuk-docker is to make it easy to develop any GOV.UK app. It achieves this by providing a variety of environments or stacks for each app, in which you can run commands, and the app itself.

RFC 106: Use Docker for local development describes the background for choosing Docker. See the list of projects which work with govuk-docker.

Installation

First make sure you have the following dependencies.

  • brew
  • git
  • A govuk directory in your home directory

Next, add the following line to your bash/zsh config.

# in ~/.bashrc or ~/.zshrc
export PATH=$PATH:~/govuk/govuk-docker/exe

Run echo $SHELL if you're not sure which shell you use. After saving, you will need to run source ~/.bashrc or source ~/.zshrc to apply this change to your current terminal session.

Now in ~/govuk , run the following setup commands.

git clone [email protected]:alphagov/govuk-docker.git
cd govuk-docker
bundle install
bin/setup

๐Ÿ‘‰ Check the troubleshooting guide if you have a problem.

Then make sure you give Docker enough resources.

Running GOV.UK applications can be resource intensive. To give Docker more resources on Mac, click the Docker whale icon in the macOS menu bar, select 'Preferences'. We suggest the following minimum resources:

  • 6 CPUs
  • 12 GB RAM
  • 64GB+ Disk

Check out the how-to guide to customise your setup.

Usage

Do this the first time you work on a project:

make collections-publisher

๐Ÿ‘‰ Check the troubleshooting guide if you have a problem.

Each project provides a number of 'stacks' for different use cases. You can see the stacks for a project in its config file. To provide consistency, all projects should follow these conventions for stacks:

The lite stack

This stack provides only the minimum number of dependencies to run the project code. This is useful for running the tests, or a Rails console, for example.

Do this to run the tests for a project:

govuk-docker run collections-publisher-lite bundle exec rake

๐Ÿ‘‰ Check the troubleshooting guide if you have a problem.

The app stack

This stack provides the dependencies necessary to run an app e.g. in a browser. If the app is a web app, you will then be able to visit it in your browser at my-app.dev.gov.uk.

Do this to start a GOV.UK web app:

govuk-docker up collections-publisher-app

๐Ÿ‘‰ Replicate data locally (or use the app-live stack).

๐Ÿ‘‰ Check the troubleshooting guide if you have a problem.

The app-* stacks

Variations on the app stack are allowed where necessary such as:

Some app stacks also depend on a worker stack, to run asynchronous tasks [example].

Resources

Contributing

Check out the CONTRIBUTING guide.

Licence

MIT License

alphagov.govuk-docker's People

Contributors

1pretz1 avatar alex-ju avatar barrucadu avatar benthorner avatar bevanloon avatar brucebolt avatar callumknights avatar cbaines avatar chao-xian avatar chrisbashton avatar dependabot-preview[bot] avatar dilwoarh avatar edwardkerry avatar emmabeynon avatar erino avatar hannako avatar huwd avatar issyl0 avatar jonathanhallam avatar karlbaker02 avatar kevindew avatar leenagupte avatar murilodalri avatar peteglondon avatar pixeltrix avatar sihugh avatar thomasleese avatar tijmenb avatar vanitabarrett avatar vitaliemogoreanu 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.