diff --git a/.gitignore b/.gitignore index e4fe5a6..d91dbba 100644 --- a/.gitignore +++ b/.gitignore @@ -16,5 +16,3 @@ node_modules # User generated docker files (Root of the project only) /db -/docker-compose.yml -/Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6d00529 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM node:latest +WORKDIR /usr/src/app +COPY package*.json ./ +COPY . . +RUN npm install +RUN cp .env.example .env +RUN chmod u+x ./start.sh +CMD ["./start.sh"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..83b588b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,46 @@ +version: "3" +services: + dispenser-fork: + image: dispenser-fork + build: . + container_name: dispenser-fork + restart: unless-stopped + environment: + #DO NOT CHANGE THE HOST + POSTGRES_HOST: db + #DO NOT CHANGE THIS UNLESS YOU KNOW WHAT YOU ARE DOING + POSTGRES_USER: dispenser-fork + #CHANGE THE PASSWORD TO SOMETHING MORE SECURE (RECOMMENDED) + POSTGRES_PASSWORD: postgres + #DO NOT CHANGE THIS UNLESS YOU KNOW WHAT YOU ARE DOING!! + POSTGRES_DB: dispenser-fork + #THIS SHOULDN'T NEED TO CHANGE + DATABASE_URL: postgres://dispenser-fork:postgres@db:5432/dispenser-fork + #### + #ANYTHING BELOW THIS NEEDS TO BE EDITED + #The discord bot's token (REQUIRED) + TOKEN: token + #The Bot ID for slash command deployment (REQUIRED) + CLIENT_ID: clientID + #The Server ID for quick deployment (Not required but recommended for quick deployment, delete line to disable) + GUILD_ID: guildID + # The ID of the Bot owner (NOT REQUIRED, delete line to disable) + OWNER_ID: ownerID + # Cooldown time in ms (set to 0 to disable) + COOLDOWN_TIME: 2000 + depends_on: + - db + db: + image: postgres:latest + container_name: dispenser-fork-db + restart: unless-stopped + environment: + POSTGRES_USER: dispenser-fork + POSTGRES_PASSWORD: postgres + POSTGRES_DB: dispenser-fork + volumes: + - ./db:/var/lib/postgresql/data +networks: + default: + external: false + name: dispenser-fork-network