build: add docker build files

This commit is contained in:
Alexander Navarro 2025-03-12 15:11:48 -03:00
parent 1871610770
commit 3c2d3cf720
6 changed files with 262 additions and 23 deletions

View file

@ -0,0 +1,38 @@
services:
compendium:
image: compendium:latest
restart: unless-stopped
depends_on:
- db
ports:
- 3000:3000
env_file:
- ../../.env
db:
image: postgres:17-alpine
ports:
- 5432:5432
environment:
POSTGRES_USER: ${CPD_DB_USER}
POSTGRES_PASSWORD: ${CPD_DB_PASSWORD}
POSTGRES_DB: ${CPD_DB_NAME}
adminer:
image: ghcr.io/shyim/adminerevo:latest
ports:
- 8080:8080
environment:
ADMINER_DEFAULT_DRIVER: psql
ADMINER_DEFAULT_SERVER: db
ADMINER_DEFAULT_USER: ${CPD_DB_USER}
ADMINER_DEFAULT_PASSWORD: ${CPD_DB_PASSWORD}
ADMINER_DEFAULT_DB: ${CPD_DB_NAME}
dbmate:
image: ghcr.io/amacneil/dbmate
restart: no
command: ["--wait", "migrate"]
volumes:
- ${PWD}/db:/db
environment:
DATABASE_URL: postgres://${CPD_DB_USER}:${CPD_DB_PASSWORD}@db:5432/${CPD_DB_NAME}?sslmode=disable

View file

@ -0,0 +1,20 @@
import sassPlugin from "@alecodes/bun-plugin-sass";
const entrypoints = Array.from(
new Bun.Glob("frontend/**/*.html").scanSync("."),
);
const result = await Bun.build({
entrypoints,
outdir: "dist",
publicPath: "/",
splitting: true,
plugins: [sassPlugin],
naming: {
entry: "[dir]/[name].[ext]",
chunk: "assets/[name]-[hash].[ext]",
asset: "assets/[name]-[hash].[ext]",
},
});
console.log("Assets compiled!");