Simplify Docker based deployments and provide example docker-compose.yml
#67
Replies: 2 comments 5 replies
-
Hello @alexandreteles, welcome to Fief 👋 The goal with the all-in-one Docker image was to provide an easy way to run a Fief system, in particular during local development. I think it's quite convenient to have a one-liner to run everything, without having to create a configuration file. Now, for a proper production deployment; yes, a Docker Compose can be useful, with the proper containers setup. We could add an example to the documentation, but it could look like something like this: # docker-compose.yml
version: "3.9"
services:
fief-server:
image: ghcr.io/fief-dev/fief:latest
command: fief run-server --port $PORT
ports:
- "8000:8000"
env_file:
- .env
fief-worker:
image: ghcr.io/fief-dev/fief:latest
command: fief run-worker -p 1 -t 1
env_file:
- .env
postgres:
image: postgres:alpine
environment:
- POSTGRES_PASSWORD=fief
- POSTGRES_USER=fief
- POSTGRES_DB=fief
volumes:
- postgres-data:/var/lib/postgresql/data
redis:
image: redis:alpine
command: redis-server --save 60 1 --loglevel warning
volumes:
- redis-data:/data
volumes:
redis-data:
postgres-data:
Notice how we override the Docker volumes are also configured so we can persist the data of the PostgreSQL and the Redis even if we delete the containers. |
Beta Was this translation helpful? Give feedback.
-
Hello @alexandreteles 👋 Following our discussion, those improvements are now live in The quickstart have been greatly simplified thanks to the automatic creation of main workspace and admin user: https://docs.fief.dev/self-hosting/quickstart/ I've also added guidelines about production deployment with Docker Compose: https://docs.fief.dev/self-hosting/deployment/docker-compose/ |
Beta Was this translation helpful? Give feedback.
-
Ideally the Docker image should contain only the fief-server and fief-worker services. Some considerations:
docker exec
to setup a Docker installation breaks the ability to run the container from docker-compose without ugly hacks (please see Execute a command after run docker/compose#1809), so allowing first-run configuration to be done viaenv
would be really cool;docker-compose.yml
file.Beta Was this translation helpful? Give feedback.
All reactions