25 lines
591 B
Docker
25 lines
591 B
Docker
FROM node:14.16.0
|
|
|
|
# Create working directory and copy required code files
|
|
RUN mkdir /workdir
|
|
ADD bot.js /workdir/bot.js
|
|
ADD package.json /workdir/package.json
|
|
ADD package-lock.json /workdir/package-lock.json
|
|
|
|
# Set the working directory
|
|
WORKDIR /workdir
|
|
|
|
# Install npm packages
|
|
RUN npm i
|
|
|
|
# Declare required environment variables
|
|
ENV API_BEARER ""
|
|
ENV IRC_OAUTH ""
|
|
ENV ACCESS_KEY ""
|
|
|
|
# Rewrite .env file every time the container starts
|
|
CMD "echo \"API_BEARER=$API_BEARER\nIRC_OAUTH=$IRC_OAUTH\nACCESS_KEY=$ACCESS_KEY\" > /workdir/.env"
|
|
CMD "cat .env"
|
|
# Start the bot
|
|
CMD ["node", "bot.js"]
|