sha256:8593310fa483eedfb37babd312159e09d79e2d7c209a5b6704de6f67a48aaa3b
Last pushed
5 days by brnshkr
Type
Compose
Manifest digest
sha256:8593310fa483eedfb37babd312159e09d79e2d7c209a5b6704de6f67a48aaa3b
services:
bun-app:
extends:
file: ./base.yaml
service: base
restart: no
image: "${FORGE_APP_DEV_IMAGE:-\
${FORGE_IMAGE_NAMESPACE:-\
${FORGE_NAMESPACE:?Set it to the namespace of Forge's images and fragments, e.g. `docker.io/brnshkr`.}}\
/${FORGE_APP_DEV_IMAGE_NAME:-${FORGE_IMAGE_NAME:-forge}}\
:${FORGE_TAG:?Set `FORGE_TAG` and `FORGE_APP_DEV_IMAGE_DIGEST`, or `FORGE_APP_DEV_IMAGE`.}-app-dev\
@${FORGE_APP_DEV_IMAGE_DIGEST:?Set `FORGE_TAG` and `FORGE_APP_DEV_IMAGE_DIGEST`, or `FORGE_APP_DEV_IMAGE`.}}"
command: >-
${BUN_APP_COMMAND:-bun
--watch
${FORGE_INSPECT:+--inspect=0.0.0.0:6499/}
run start}
working_dir: /app
user: ${HOST_UID:-1000}:${HOST_GID:-1000}
mem_limit: ${BUN_APP_DEV_CONTAINER_MEMORY_LIMIT:-${BUN_APP_CONTAINER_MEMORY_LIMIT:-2g}}
pids_limit: ${BUN_APP_DEV_CONTAINER_PIDS_LIMIT:-${BUN_APP_CONTAINER_PIDS_LIMIT:-512}}
extra_hosts:
- host.docker.internal:host-gateway
sysctls:
net.ipv4.ip_unprivileged_port_start: 0
environment:
BUN_INSTALL_CACHE_DIR: /app/.cache/bun.cache
HOST: 0.0.0.0
NODE_ENV: development
PORT: 80
TZ: ~
XDG_CACHE_HOME: /app/.cache/xdg.cache
XDG_CONFIG_HOME: /app/.cache/xdg.cache
XDG_DATA_HOME: /app/.cache/xdg.cache
healthcheck:
test:
- CMD-SHELL
- >-
ls -A /app | grep -q . \
&& bun -e "fetch('http://127.0.0.1:80/')
.then((response) => process.exit(response.status >= 500 ? 1 : 0))
.catch(() => process.exit(1))"
interval: 10s
timeout: 3s
retries: 10
ports:
- ${APP_HOST_IP:-127.0.0.1}:${BUN_APP_HTTP_PORT:-${APP_HTTP_PORT:?}}:80
- ${APP_HOST_IP:-127.0.0.1}:${BUN_APP_INSPECT_PORT:-${APP_INSPECT_PORT:-6499}}:6499
tmpfs:
- /tmp:rw,nosuid,nodev,size=512m
- /run:rw,nosuid,nodev,size=32m
volumes:
- ${HOST_APP_DIR:-${PWD}}:/app:rw
- forge-home:/home/forge
volumes:
forge-home: ~
services:
base:
restart: unless-stopped
logging:
driver: local
init: true
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
docker compose -f oci://brnshkr/forge-compose-bun-app-dev:0.0.1-alpha.1 upUse the above command to pull and run the Compose file. Learn more.