[server] Remove extra container by using a post_start lifecycle hook

This commit is contained in:
Manav Rathi
2025-03-19 19:47:46 +05:30
parent f145e0b424
commit c329b30e49
4 changed files with 72 additions and 28 deletions

View File

@@ -311,6 +311,10 @@ export const sidebar = [
text: "Uploads",
link: "/self-hosting/troubleshooting/uploads",
},
{
text: "Docker",
link: "/self-hosting/troubleshooting/docker",
},
{
text: "Yarn",
link: "/self-hosting/troubleshooting/yarn",

View File

@@ -0,0 +1,50 @@
---
title: Docker errors
description: Fixing docker related errors when trying to self host Ente
---
# Docker
The `server/compose.yaml` Docker compose file uses the "post_start" lifecycle
hook to provision the MinIO instance.
The lifecycle hook **requires Docker Compose version 2.30.0+**, and if you're
using an older version of docker compose you will see an error like this:
```
validating compose.yaml: services.minio Additional property post_start is not allowed
```
The easiest way to resolve this is to upgrade your Docker compose.
If you cannot update your Docker compose version, then alternatively you can
perform the same configuration by removing the "post_start" hook, and adding a
new service definition:
```yaml
minio-provision:
image: minio/mc
depends_on:
- minio
volumes:
- minio-data:/data
networks:
- internal
entrypoint: |
sh -c '
#!/bin/sh
while ! mc config host add h0 http://minio:3200 changeme changeme1234
do
echo "waiting for minio..."
sleep 0.5
done
cd /data
mc mb -p b2-eu-cen
mc mb -p wasabi-eu-central-2-v3
mc mb -p scw-eu-fr-v3
'
```

View File

@@ -5,7 +5,8 @@ description: Fixing yarn install errors when trying to self host Ente
# Yarn
If your `yarn install` is failing, make sure you are using Yarn Classic
If your `yarn install` is failing, make sure you are using Yarn v1 (also known
as "Yarn Classic"):
- https://classic.yarnpkg.com/lang/en/docs/install

View File

@@ -60,45 +60,34 @@ services:
minio:
image: minio/minio
# Use different ports than the minio defaults to avoid conflicting
# with the ports used by Prometheus.
ports:
- 3200:3200 # API
- 3201:3201 # Console
- 3200:3200 # MinIO API
- 3201:3201 # MinIO Console
environment:
MINIO_ROOT_USER: changeme
MINIO_ROOT_PASSWORD: changeme1234
# Tweak this command to match the above port changes.
command: server /data --address ":3200" --console-address ":3201"
volumes:
- minio-data:/data
networks:
- internal
post_start:
- command: |
sh -c '
#!/bin/sh
minio-provision:
image: minio/mc
depends_on:
- minio
volumes:
- minio-data:/data
networks:
- internal
entrypoint: |
sh -c '
#!/bin/sh
while ! mc config host add h0 http://minio:3200 changeme changeme1234 2>/dev/null
do
echo "Waiting for minio..."
sleep 0.5
done
while ! mc config host add h0 http://minio:3200 changeme changeme1234
do
echo "waiting for minio..."
sleep 0.5
done
cd /data
cd /data
mc mb -p b2-eu-cen
mc mb -p wasabi-eu-central-2-v3
mc mb -p scw-eu-fr-v3
'
mc mb -p b2-eu-cen
mc mb -p wasabi-eu-central-2-v3
mc mb -p scw-eu-fr-v3
'
volumes:
custom-logs: