The services that you are building need to be packaged as Docker container images. For that, you do not need to write a Dockerfile or anything like that. We already have pre-defined types of Docker image packaging that you should use.

What should I do then?

You need to ask the DevOps team to create a Docker repository for you, which has the same name your service has in NX. This is an important convention to make everyone's lives easier. Then you need to manually add to your project's project.json file a target that describes what kind of Docker packaging it needs. For example, adding this target

  "docker-next": {}

means your service will be packaged as a NextJS Docker container image. We have support the following types of Docker containers:

  • docker-next: suitable for NextJS services.

  • docker-express, suitable for ExpressJS as well as NestJS services.

  • docker-static, suitable for serving all types of static content. Suitable for pure HTML or React SPAs.

  • docker-cypress, suitable for running cypress tests in docker.

  • docker-native, not implemented

If you would like to see some examples, simply search for "docker" in that file and you should find plenty.

When you push this change to main your Docker image will get built and pushed to our private central Docker registry

To dockerize a NextJS project, you additionally need to configure it to use our custom server.

Can I create a secret in the aws parameters store for services to consume?

Yes you can! Find out about it on the AWS Secrets documentation.


Prerequisite: Local Docker support

If you are having problems with your application running inside a Docker container, you can troubleshoot that by downloading the Docker container and running it locally on your workstation.

To do that you need to follow this process:

  1. Login to our AWS Shared account and get command line access settings

  2. Open your terminal and paste the AWS creds from the clipboard

  3. Run this to authenticate to our private Docker registry

     aws ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin
  4. Now you can poke around in the Docker container like this (Docker image and tag can be retrieved from a few places, depending on where you are starting from - Spinnaker, GitHub CI, Kubenav/Kubernetes)

     docker run --rm -it --entrypoint=sh<image>:<tag>

Last updated