This document outlines the Docker build strategy for the React Router Nest application.
Our Docker images are built and published with support for multiple architectures:
linux/amd64
(x86_64) - For standard x86-based serverslinux/arm64
(aarch64) - For ARM-based servers, including AWS Graviton, Apple Silicon, and many cloud ARM instances
This multi-architecture approach eliminates the need for emulation and provides native performance on all supported platforms.
The Docker images are built automatically through GitHub Actions when a new version tag is pushed:
- The workflow in
.github/workflows/release-tag.yml
is triggered on tag push matchingv*.*.*
pattern - The Docker Buildx action builds the images for multiple platforms
- Images are pushed to GitHub Container Registry (ghcr.io)
ghcr.io/cbnsndwch/react-router-nest-server:latest
- Latest stable releaseghcr.io/cbnsndwch/react-router-nest-server:v{x.y.z}
- Specific version (e.g.,v0.4.6
)
If you need to build multi-architecture images locally:
# Set up Docker Buildx builder
docker buildx create --name multiarch --use
# Build and push
docker buildx build --platform linux/amd64,linux/arm64 \
-t ghcr.io/cbnsndwch/react-router-nest-server:local \
-f apps/server/Dockerfile \
--push \
.
For information about deploying these images in a Docker Swarm environment, see the Docker Stack documentation.
- Base image selection: We use the official Node Alpine images as they provide a good balance between size and functionality.
- Multi-stage builds: Our Dockerfile uses multi-stage builds to keep the final image small.
- Layer caching: We organize commands to maximize Docker layer caching.
- Security: We run the application as a non-root user where possible.
- Metadata: We apply appropriate OCI-compliant labels to our images.