GELLIFY.dev

Get started

Docker

You can containerize this stack and deploy it as a single container using Docker, or as a part of a group of containers using docker-compose.

Docker Project Configuration

Please note that Next.js requires a different process for build time (available in the frontend, prefixed by NEXT_PUBLIC) and runtime environment, server-side only, variables. In this demo we are using two variables, pay attention to their positions in the Dockerfile, command-line arguments, and docker-compose.yml:

DATABASE_URL (used by the server) NEXT_PUBLIC_CLIENTVAR (used by the client)

Build and Run Image Locally

Build and run this image locally with the following commands:

docker build -t gellify-docker --build-arg NEXT_PUBLIC_CLIENTVAR=clientvar .
docker run -p 3000:3000 -e DATABASE_URL="database_url_goes_here" gellify-docker

Open localhost:3000↗ to see your running application.

Resources