diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1d4e483 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,16 @@ +# Pointless stuff +Dockerfile +docker-compose.yml +.ncurc.json +.env +.mailmap +.github +.vscode +.github +postgres-replica-stuff +README.md +ufwReject.sh + +# Startup files +startWithYarn.cjs +botStartup.bat diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..298b3f5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM node:21.1.0-bookworm-slim +ENV YARN_VERSION 4.0.2 +RUN yarn policies set-version $YARN_VERSION +RUN apt update -y && apt upgrade -y && apt install -y git +RUN npm install -g typescript +WORKDIR /Daggerbot +RUN git config --global --add safe.directory /Daggerbot +COPY tsconfig.json package.json yarn.lock .yarnrc.yml ./ +RUN yarn workspaces focus + +CMD [ "yarn", "node", "." ] diff --git a/docker-compose.yml b/docker-compose.yml index 7a61ddc..731c8d2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,12 @@ services: + bot: + container_name: daggerbot-prod + build: . + restart: unless-stopped + volumes: + - ./.git:/Daggerbot/.git:rw + - ./src/:/Daggerbot/src/:rw + - ./dist/:/Daggerbot/dist/:rw cache: container_name: redis-cache image: redis/redis-stack-server:7.2.0-v6