diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..6e237e5 --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +GH_TOKEN= diff --git a/.gitignore b/.gitignore index 577a4f1..73ebed9 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,6 @@ node_modules/ .eslintcache # build output -dist/ \ No newline at end of file +dist/ + +.env diff --git a/Dockerfile b/Dockerfile index 0d8f3d5..afee000 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,8 +20,8 @@ EXPOSE 4141 HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ CMD wget --spider -q http://localhost:4141/ || exit 1 -ARG GH_TOKEN -ENV GH_TOKEN=$GH_TOKEN +COPY entrypoint.sh /entrypoint.sh -ENTRYPOINT ["bun", "run", "dist/main.js"] -CMD ["start", "-g", "$GH_TOKEN"] +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..82b770d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +services: + copilot-api: + build: . + ports: + - "4141:4141" + environment: + - GH_TOKEN=${GH_TOKEN} + restart: unless-stopped diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..5a01494 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,2 @@ +#!/bin/sh +exec bun run dist/main.js start -g "$GH_TOKEN"