From 3e932a0d6bc845c05701cf7fdd84bf6a4eccdf97 Mon Sep 17 00:00:00 2001 From: JandereDev Date: Mon, 18 Apr 2022 21:16:12 +0200 Subject: [PATCH] more docker stuff --- .env.example | 3 +++ bridge/Dockerfile | 13 +++++++++++++ docker-compose.yml.example | 8 ++++++++ 3 files changed, 24 insertions(+) create mode 100644 bridge/Dockerfile diff --git a/.env.example b/.env.example index d3436a9..c325b81 100644 --- a/.env.example +++ b/.env.example @@ -13,6 +13,9 @@ DB_PASS= # Your bot account's token. BOT_TOKEN= +# A Discord bot token, used for the bridge service. +BOT_TOKEN_DISCORD= + # The default prefix, can be overridden by server owners. # Leave empty to keep default ("/") BOT_PREFIX= diff --git a/bridge/Dockerfile b/bridge/Dockerfile new file mode 100644 index 0000000..e29635c --- /dev/null +++ b/bridge/Dockerfile @@ -0,0 +1,13 @@ +FROM node:16 as build +WORKDIR /build/ +COPY package.json yarn.lock ./ +RUN yarn install --frozen-lockfile +COPY . . +RUN yarn build + +FROM node:16 as prod +WORKDIR /app/ +COPY --from=build /build/package.json /build/yarn.lock ./ +COPY --from=build /build/dist ./dist +RUN yarn install --production --frozen-lockfile +CMD ["yarn", "start"] diff --git a/docker-compose.yml.example b/docker-compose.yml.example index 7dd7a1a..24502a7 100644 --- a/docker-compose.yml.example +++ b/docker-compose.yml.example @@ -45,6 +45,14 @@ services: - 0.0.0.0:9000:9000 restart: unless-stopped + bridge: + build: ./bridge + environment: + - REVOLT_TOKEN=${BOT_TOKEN} + - DISCORD_TOKEN=${BOT_TOKEN_DISCORD} + - DB_STRING=mongodb://mogus:${DB_PASS}@mongo:27017/admin + restart: unless-stopped + # If you prefer to host the web app on a different # platform like Vercel, you can remove this part. web: