Serves vinum for you to use and enjoy.
Duplicate .env.example and rename it to .env in the project root with the following variables:
The following environment variables are available:
VINUMC_SOURCE: Set torelease(default) to use pre-built binary from GitHub releases, orlocalto use a locally built binaryVINUMC_VERSION: The version of vinumc to download (default:vinumc-v0.1.0-alpha)VINUMC_PATH: Path to your locally built vinumc binary (only needed whenVINUMC_SOURCE=local)DATABASE_URL: PostgreSQL connection stringPOSTGRES_USER: PostgreSQL usernamePOSTGRES_PASSWORD: PostgreSQL password
pnpm installThis will start Vite with HMR on port 5173, mounting your source and Vinum compiler into a container:
docker compose --profile dev up --buildThen open your browser to http://localhost:5173.
There are two profiles in docker-compose.yml: dev and prod.
docker-compose --profile dev up --build
# or explicitly
docker-compose --profile dev-release up --builddocker-compose --profile dev-local up --build- app/app-release: runs
pnpm dev --host 0.0.0.0on port 5173 with release binary - app-local: runs
pnpm dev --host 0.0.0.0on port 5173 with local binary - db: PostgreSQL on port 5432 (persistent data in
pgdatavolume) - Source code is bind-mounted for live reload
docker-compose --profile prod up --build -d- db: same Postgres service
- app-prod: runs the production SvelteKit build on port 3000
vinumcis downloaded from its Github releases page using the version specified inVINUMC_VERSION.
To tear down both workflows:
docker-compose downBy default, the application uses pre-built vinumc binaries from GitHub releases:
# Use the default version (vinumc-v0.1.0-alpha)
VINUMC_SOURCE=release
# Or specify a different version
VINUMC_SOURCE=release
VINUMC_VERSION=vinumc-v0.1.0-alphaIf you want to use your locally built vinumc binary during development:
VINUMC_PATH=/path/to/your/vinumcThen use the local profile:
docker-compose --profile dev-local up --buildThe local binary will be mounted into the container during development.
Note: Production builds always use the release version for consistency and reliability.
The Docker build process uses ARG variables that are passed from environment variables:
- Environment Variables (in
.envfile) → - Docker Compose (
args:section) → - Dockerfile (
ARGdeclarations) → - Build Process (used in
RUNcommands)
For example:
# In .env file
VINUMC_VERSION=vinumc-v0.1.0-alpha
# In docker-compose.yml
args:
VINUMC_VERSION: ${VINUMC_VERSION:-vinumc-v0.1.0-alpha}
# In Dockerfile
ARG VINUMC_VERSION=vinumc-v0.1.0-alpha
RUN curl -L "https://github.com/vinumdoc/vinum/releases/download/${VINUMC_VERSION}/vinumc"pnpm run build
pnpm run preview # Preview on http://localhost:4173 by defaultThe app-prod service is built using a multi-stage Dockerfile. It fetches dependencies, compiles your SvelteKit app, and downloads the Vinum compiler from GitHub releases. The version can be configured via the VINUMC_VERSION environment variable.