Repository to consolidate efforts on making a sweet Docker implementation for RedwoodJS. Discussion on Dockerize RedwoodJS.
Name | API | Web | Both |
---|---|---|---|
jeliasson-nginx | yarn rw serve api |
nginx:alpine image |
- |
standal-ce-nginx | rw-api-server |
nginx:1.21.3-alpine image |
- |
standal-cli-both | - | - | rw serve |
Meta
Name | jeliasson-nginx |
Description | A test implementation that builds api and web seperately. |
Workflow | |
Maintainer | Johan Eliasson |
Packages
Name | Runtime |
---|---|
api | yarn rw serve api |
web | nginx:alpine |
Benchmark
Benchmark on running averages
Package | Build time | Image size |
---|---|---|
api | 3m 12s |
1.69GB |
web | 1m 46s |
25.3MB |
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
Meta
Name | standal-ce-nginx |
Description | An implementation built for a deployment to IBM's Code Engine, with its best practices built in. |
Workflow | |
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
Meta
Name | standal-cli-both |
Description | Builds and serves both sides from a single image, using Redwood's CLI. |
Workflow | |
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 \
-it \
--rm \
-p 8910:8910 \
ghcr.io/redwoodjs/docker-standal-cli-both-dev:latest
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. 🚀
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
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
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).