Skip to content

Commit

Permalink
fix: 🚀 fix and rewrote docker stuff
Browse files Browse the repository at this point in the history
I reworked the docker files and added docker support for the new config system.

The old config system is no longer working
  • Loading branch information
jqshuv committed Jul 5, 2022
1 parent 8a10730 commit fbcbf85
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 139 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.vscode
.husky
.github
.cspell
.env
node_modules
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,8 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*


# Docker
database
docker-compose.local.yml
20 changes: 3 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,16 @@
FROM node:16

LABEL maintainer="me@jqshuv.xyz"
LABEL org.opencontainers.image.source https://github.com/ZynerOrg/xyter
LABEL org.opencontainers.image.description "An multi-purpose discord.js bot."
LABEL org.opencontainers.image.licenses=GPL-3.0-only

LABEL maintainer="xyter@zyner.org"

WORKDIR /app

LABEL maintainer="me@jqshuv.xyz"
LABEL org.opencontainers.image.source https://github.com/ZynerOrg/xyter
LABEL org.opencontainers.image.description "An multi-purpose discord.js bot."
LABEL org.opencontainers.image.licenses=GPL-3.0-only

COPY package* .
RUN npm install

COPY . .
RUN mv src/config_docker src/config

RUN npx tsc

RUN npx tsc -v > /app/tsc.log
RUN npm -v > /app/npm.log
RUN node -v > /app/node.log
RUN npx -y tsc

WORKDIR /app/build

CMD [ "npx", "nodemon" ]
CMD [ "node", "." ]
33 changes: 33 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
services:
app:
depends_on:
- mongodb
build: .
restart: unless-stopped
environment:
- DISCORD_TOKEN=YOUR TOKEN
- DISCORD_CLIENT_ID=YOUR CLIENT ID
- DISCORD_GUILD_ID=YOUR GUILD ID
### LEAVE THIS AS IT IS! ###
- MONGO_URL=mongodb://mongodb:27017/xyter?retryWrites=true&w=majority
############################
- ENCRYPTION_ALGORITHM=aes-256-ctr
- ENCRYPTION_SECRET=A RANDOM STRING WITH LENGTH OF 32
- EMEBD_COLOR_SUCCESS=#22bb33
- EMBED_COLOR_WAIT=#f0ad4e
- EMBED_COLOR_ERROR=#bb2124
- EMBED_FOOTER_TEXT=https://github.com/ZynerOrg/xyter
- EMBED_FOOTER_ICON=https://github.com/ZynerOrg.png
- LOG_LEVEL=silly
- REPUTATION_TIMEOUT=86400
- BOT_HOSTER_NAME=Zyner
- BOT_HOSTER_URL=https://xyter.zyner.org/customization/change-hoster
- NODE_ENV=production
stdin_open: true
tty: true
mongodb:
image: mongo:4.2.21
restart: unless-stopped
volumes:
- ./logs:/app/build/logs
- ./database:/data/db
44 changes: 22 additions & 22 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@ services:
app:
depends_on:
- mongodb
build: .
image: zyner/xyter:2022.07.0
restart: unless-stopped
environment:
# You can leave this as-is.
- DB_HOST=mongodb
- DB_USER=mongouser
- DB_PASSWORD=mongopasword
- DB_NAME=xyter
- DB_PORT=27017
# You have to set these values!
- DISCORD_TOKEN=YOUR_DISCORD_TOKEN
- DISCORD_CLIENT_ID=YOUR_CLIENT_ID
- DISCORD_DEV_GUILD_ID=YOUR_DEV_GUILD_ID
- HOSTER_NAME=YOUR_HOSTER_NAME
- NODE_ENV=development
- DISCORD_TOKEN=YOUR TOKEN
- DISCORD_CLIENT_ID=YOUR CLIENT ID
- DISCORD_GUILD_ID=YOUR GUILD ID
### LEAVE THIS AS IT IS! ###
- MONGO_URL=mongodb://mongodb:27017/xyter?retryWrites=true&w=majority
############################
- ENCRYPTION_ALGORITHM=aes-256-ctr
- ENCRYPTION_SECRET=A RANDOM STRING WITH LENGTH OF 32
- EMEBD_COLOR_SUCCESS=#22bb33
- EMBED_COLOR_WAIT=#f0ad4e
- EMBED_COLOR_ERROR=#bb2124
- EMBED_FOOTER_TEXT=https://github.com/ZynerOrg/xyter
- EMBED_FOOTER_ICON=https://github.com/ZynerOrg.png
- LOG_LEVEL=silly
- REPUTATION_TIMEOUT=86400
- BOT_HOSTER_NAME=Zyner
- BOT_HOSTER_URL=https://xyter.zyner.org/customization/change-hoster
- NODE_ENV=production
stdin_open: true
tty: true
mongodb:
image: mongo:latest
image: mongo:4.2.21
restart: unless-stopped
environment:
- MONGO_INITDB_ROOT_USERNAME=mongouser
- MONGO_INITDB_ROOT_PASSWORD=mongopasword
ports:
- $MONGODB_LOCAL_PORT:27017
volumes:
- db:/data/db
volumes:
db:
- ./logs:/app/build/logs
- ./database:/data/db
7 changes: 0 additions & 7 deletions src/config_docker/database.ts

This file was deleted.

14 changes: 0 additions & 14 deletions src/config_docker/discord.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/config_docker/embed.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/config_docker/encryption.ts

This file was deleted.

25 changes: 0 additions & 25 deletions src/config_docker/other.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/config_docker/reputation.ts

This file was deleted.

27 changes: 0 additions & 27 deletions src/types/enviroment.d.ts

This file was deleted.

0 comments on commit fbcbf85

Please sign in to comment.