Skip to content

Repository to consolidate efforts on making sweet Docker implementations for RedwoodJS

Notifications You must be signed in to change notification settings

ScottFred/docker_redwoodjs

 
 

Repository files navigation

Redwood on Docker

This is a collaboration repository to consolidate efforts on making sweet Docker implementations for RedwoodJS. Discussion on Dockerize RedwoodJS and Define official Docker images. This repository is currently up to date with Redwood version 1.5.1.

Implementations

Name Description Workflow
jeliasson-nginx A production tested implementation that builds api and web seperately. jeliasson-nginx
standal-ce-nginx An implementation built for a deployment to IBM's Code Engine, with its best practices built in. standal-ce-nginx
standal-cli-both Builds and serves both sides from a single image, using Redwood's CLI. standal-cli-both
pi0neerpat-packages Similar to jeliasson-nginx, but supports 📦 local packages pi0neerpat-packages

jeliasson-nginx

Meta

Name jeliasson-nginx
Description A production tested implementation that builds api and web seperately.
Workflow jeliasson-nginx
Maintainer Johan Eliasson

Packages

Name Runtime
api rw-api-server
web node:14-alpine

Benchmark

Benchmark on running averages

Package Build time Image size
api ~2m 18s 617MB
web ~1m 24s 142MB

Suitable for

Scenario Development Production
Basic installation
Preferably w/ LB/proxy
High Availability
Separation of concern
Handles db migration & seed
...

Test

# Api
docker run -it --rm \
      -p 8911:8911 \
      ghcr.io/redwoodjs/docker-jeliasson-nginx-api-dev:latest

# Web
docker run -it --rm \
      -p 8910:8910 \
      ghcr.io/redwoodjs/docker-jeliasson-nginx-web-dev:latest

standal-ce-nginx

Meta

Name standal-ce-nginx
Description An implementation built for a deployment to IBM's Code Engine, with its best practices built in.
Workflow standal-ce-nginx
Maintainer Ryan Lockard

Packages

Name Runtime
api rw-api-server
web nginx:1.21.3-alpine

Benchmark

Benchmark on running averages

Package Build time Image size
api ~2m 57s 410MB
web ~2m 5s 25.3M

Suitable for

Scenario Development Production
Basic installation
Preferably w/ LB/proxy
High Availability
Separation of concern
Handles db migration & seed
...

Test

# Api
docker run -it --rm \
      -p 8911:8911 \
      ghcr.io/redwoodjs/docker-standal-ce-nginx-api-dev:latest

# Web
docker run -it --rm \
      -p 8910:8910 \
      ghcr.io/redwoodjs/docker-standal-ce-nginx-web-dev:latest

standal-cli-both

Meta

Name standal-cli-both
Description Builds and serves both sides from a single image, using Redwood's CLI.
Workflow standal-cli-both
Maintainer Ryan Lockard

Packages

Name Runtime
both rw serve

Benchmark

Benchmark on running averages

Package Build time Image size
both ~3m 33s tbd

Suitable for

Scenario Development Production
Basic installation
Preferably w/ LB/proxy
High Availability
Separation of concern
Handles db migration & seed
...

Test

docker run \
t \
rm \
      -p 8910:8910 \
      ghcr.io/redwoodjs/docker-standal-cli-both-dev:latest

pi0neerpat-packages

NOTE: not everything can be run here. Instead see: https://github.com/pi0neerpat/redwood-devops-example

Meta

Name pi0neerpat-packages
Description Similar to jeliasson-nginx, but supports 📦 local packages
Workflow pi0neerpat-packages
Maintainer Patrick

Packages

Name Runtime
api rw-api-server
web nginx

Benchmark

Similar to jeliasson-nginx

Suitable for

Scenario Development Production
Basic installation
Preferably w/ LB/proxy
High Availability
Separation of concern
Handles db migration & seed
Supports local packages
...

Contribution

Essentialy we create various test implementations under the docker directory and create workflows to build these. Once we find a suitable approach forward, we'll discuss where the final Dockerfiles ultimately end up after a yarn rw setup docker (or what we end up with) setup. 🚀

Dockerfiles

Add below LABEL to bottom each Dockerfile to connect published Docker image to this repository.

### Connect image to repository
LABEL org.opencontainers.image.source=https://github.com/redwoodjs/docker

Images

Published Docker images to GitHub Container Registry should preferably be named;

  • docker-<prefix>-api-dev for api build with development as runtime env.
  • docker-<prefix>-web-dev for web build with development as runtime env.
  • docker-<prefix>-both-dev for api and web build with development as runtime env.
  • docker-<prefix>-api-prod for api build with production as runtime env.
  • docker-<prefix>-web-prod for web build with production as runtime env.
  • docker-<prefix>-both-prod for api and web build with production as runtime env.

e.g.

  • docker-jeliasson-nginx-web-dev

Benchmarks

To keep track of the implementations effectiveness, we maintain a running average on below metrics.

  • Build Size: On successful builds we display the image size in the analyse stage. In this stage we also run a dive analysis.
  • Build time: Average time for 'Docker build' completion in respective workflow.

CI

Feel free to copy and paste .github/workflows/template.yml and we try to make out a common baseline. It should build and publish the image(s) to GitHub Container Registry (see template).

About

Repository to consolidate efforts on making sweet Docker implementations for RedwoodJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 49.6%
  • TypeScript 39.2%
  • JavaScript 8.2%
  • HTML 1.6%
  • Shell 1.4%