This guide demonstrates how to test your custom portal build using this template.
docker build -t my-portal .For local Docker testing:
docker run -p 8080:8080 my-portalFor Coolify deployment: Do not specify port mappings. Coolify handles port exposure automatically.
Local testing:
Open your browser and navigate to http://localhost:8080 to verify the portal is running.
Coolify deployment: Access your portal through the domain configured in Coolify.
# Build with specific portal version
docker build --build-arg PORTAL_VERSION=develop -t my-portal-dev .
# Build with multiple build arguments
docker build \
--build-arg PORTAL_VERSION=develop \
--build-arg PLUGINS="go.lumeweb.com/portal-plugin-core@develop" \
-t my-portal-custom .Modify your Dockerfile to use environment variables:
FROM ghcr.io/lumeweb/portal-builder:latest AS builder
ARG PLUGINS
ENV PLUGINS=${PLUGINS}
RUN build-portalThen build:
docker build --build-arg PLUGINS="go.lumeweb.com/portal-plugin-dashboard@latest" -t my-portal .Before building, validate your portal-plugins.yaml:
# Install check-jsonschema
pip install check-jsonschema
# Validate against the schema from portal-builder
# (You'll need to download schema.json from portal-builder first)
check-jsonschema --schemafile schema.json portal-plugins.yamlTest building for multiple platforms:
# Create a new builder instance if needed
docker buildx create --use
# Build for multiple platforms
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t my-portal:latest \
--load \
.# Build with verbose output
docker build --progress=plain -t my-portal .# View image details
docker inspect my-portal
# Check the portal binary
docker run --rm my-portal ls -la /usr/local/bin/portal
# Check portal version
docker run --rm my-portal portal --version# Run container with shell for debugging
docker run -it --rm --entrypoint sh my-portal
# Once inside, run portal manually
portal --help- Verify the plugin module path is correct
- Check that the version exists in the plugin's repository
- Try using
latestordevelopif a specific version fails
- Ensure your
portal-plugins.yamlfollows the correct format - Check that
moduleis a valid Go module path - Verify that
versionis a valid semantic version orlatest
- Use Docker layer caching:
docker build --cache-from my-portal:latest -t my-portal . - Consider using a local registry for caching
- The portal-builder image includes a pre-populated Go module cache for faster builds
- Check if the port is already in use:
lsof -i :8080 - Review container logs:
docker logs my-portal - Verify the portal binary was copied correctly
time docker build -t my-portal .# Run with resource limits
docker run -p 8080:8080 \
--memory="512m" \
--cpus="1.0" \
my-portal
# Monitor resource usage
docker stats# Create a test configuration directory
mkdir -p ./config
echo '{"port": 8080}' > ./config/portal.json
# Run with mounted configuration
docker run -p 8080:8080 \
-v $(pwd)/config:/home/portal/config \
my-portalUpdate portal-plugins.yaml with multiple plugins:
plugins:
- module: go.lumeweb.com/portal-plugin-core
version: develop
- module: go.lumeweb.com/portal-plugin-dashboard
version: develop
- module: go.lumeweb.com/portal-plugin-ipfs
version: developBuild and test:
docker build -t my-portal-multi .
docker run -p 8080:8080 my-portal-multiBefore deploying to Coolify:
- Verify Dockerfile: Ensure
EXPOSEis commented out (it should be by default) - Test locally: Run local tests to ensure your portal builds correctly
- Check portal-plugins.yaml: Verify your plugin configuration
- Push your code to a Git repository that Coolify can access
- In Coolify, create a new application
- Select "Dockerfile" as the build pack
- Configure your environment variables if needed
- Set up your domain in Coolify
- Deploy
- Port Management: Coolify automatically manages port exposure. Do not override this.
- Environment Variables: Set
PORTAL_VERSION,PLUGINS, etc. in Coolify's environment variables section. - Build Arguments: Configure build arguments in Coolify's application settings if needed.
"Port is already allocated" error:
- Ensure
EXPOSEis commented out in your Dockerfile - Do not specify port mappings in Coolify's deployment settings
Application not accessible:
- Verify your domain is correctly configured in Coolify
- Check that the application is running in Coolify dashboard
- Review application logs in Coolify
# Remove specific image
docker rmi my-portal
# Remove all test images
docker images | grep my-portal | awk '{print $3}' | xargs docker rmi
# Clean up unused resources
docker system prune# Stop all running containers
docker stop $(docker ps -q)
# Remove all containers
docker rm $(docker ps -aq)