A Discord bot built using Node.js, discordjs, and a custom GraphQL weather endpoint - nWeather as a weather-reporting bot.
This app includes a Dockerfile
to build an image off of, as long as you have a valid .env
file to run using. The scripts to build are saved in package.json
"scripts": {
"build:docker": "yarn build:docker:image; yarn build:docker:container",
"build:docker:image": "docker build --tag josefaidt/hansl:latest --tag josefaidt/hansl:$npm_package_version .",
"build:docker:image:remote": "docker build https://github.com/josefaidt/discord-hansl.git",
"build:docker:container": "docker container run -p 3000:3000 --name hansl --hostname APP_DISCORD_HANSL --env-file ./app/.env josefaidt/hansl:$npm_package_version"
}
Ensure you have both yarn and Docker installed in order to successfully build the image and container.
build:docker:image
: builds the Docker image using the local assetsbuild:docker:image:remote
: builds the Docker image using the master branch on the repositorybuild:docker:container
: stops and removes existing containers using the namehansl
, and builds a new container using the pulled image.env-file
(required): specify using an absolute path your environment dotfile based off provided.config/.env.sample
build:docker
: runs the production build process, builds the Docker image from local assets, builds Docker container