diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..4fd21b73 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,25 @@ +services: + proxy: + image: valian/docker-nginx-auto-ssl + restart: on-failure + ports: + - 80:80 + - 443:443 + volumes: + - ssl_data:/etc/resty-auto-ssl + environment: + FORCE_HTTPS: true + SITES: relay.domain.com=relay:50000 + depends_on: + - relay + + relay: + build: + context: packages/node + dockerfile: Dockerfile + ports: + - 50000:50000 + command: relay + +volumes: + ssl_data: diff --git a/packages/node/Dockerfile b/packages/node/Dockerfile new file mode 100644 index 00000000..1f4bd908 --- /dev/null +++ b/packages/node/Dockerfile @@ -0,0 +1,8 @@ +FROM node:22.3-bookworm-slim + +WORKDIR /node +COPY . . + +RUN chmod +x /node/entrypoint.sh + +ENTRYPOINT ["/bin/bash", "/node/entrypoint.sh"] diff --git a/packages/node/entrypoint.sh b/packages/node/entrypoint.sh new file mode 100644 index 00000000..15ea7051 --- /dev/null +++ b/packages/node/entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/bash +yarn +exec yarn run "$@" diff --git a/packages/node/package.json b/packages/node/package.json index 4ef64aae..daa45b76 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -8,12 +8,7 @@ }, "type": "module", "types": "./dist/src/index.d.ts", - "files": [ - "src", - "dist", - "!dist/test", - "!**/*.tsbuildinfo" - ], + "files": ["src", "dist", "!dist/test", "!**/*.tsbuildinfo"], "exports": { ".": { "types": "./dist/src/index.d.ts", @@ -30,7 +25,9 @@ "test": "vitest" }, "devDependencies": { + "@types/node": "^20.14.2", "tsx": "^4.15.6", + "typescript": "^5.4.5", "vitest": "^1.6.0" }, "dependencies": {