Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
Removed envs from build
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexDyakonov committed Jul 26, 2024
1 parent 315ca9d commit 5834022
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 27 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
develop="true"
PORT="3500"
bot_token="token"
bot_username="dishadsh_bot"
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/cd-build-push-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,4 @@ jobs:
push: true
tags: |
shampiniony/dishdash-bot:latest
shampiniony/dishdash-bot:${{ env.COMMIT_SHORT_SHA }}
secrets: |
API_URL=${{ secrets.API_URL }}
BOT_TOKEN=${{ secrets.BOT_TOKEN }}
BOT_URL=${{ secrets.BOT_URL }}
BOT_USERNAME=${{ secrets.BOT_USERNAME }}
DEVELOP=${{ secrets.DEVELOP }}
FRONTEND_URL=${{ secrets.FRONTEND_URL }}
HOST_URL=${{ secrets.HOST_URL }}
PORT=${{ secrets.PORT }}
shampiniony/dishdash-bot:${{ env.COMMIT_SHORT_SHA }}
17 changes: 0 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,4 @@ RUN npm install

COPY . .

RUN --mount=type=secret,id=API_URL \
--mount=type=secret,id=BOT_TOKEN \
--mount=type=secret,id=BOT_URL \
--mount=type=secret,id=BOT_USERNAME \
--mount=type=secret,id=DEVELOP \
--mount=type=secret,id=FRONTEND_URL \
--mount=type=secret,id=HOST_URL \
--mount=type=secret,id=PORT \
sh -c 'echo API_URL=$(cat /run/secrets/API_URL) >> .env && \
echo BOT_TOKEN=$(cat /run/secrets/BOT_TOKEN) >> .env && \
echo BOT_URL=$(cat /run/secrets/BOT_URL) >> .env && \
echo BOT_USERNAME=$(cat /run/secrets/BOT_USERNAME) >> .env && \
echo DEVELOP=$(cat /run/secrets/DEVELOP) >> .env && \
echo FRONTEND_URL=$(cat /run/secrets/FRONTEND_URL) >> .env && \
echo HOST_URL=$(cat /run/secrets/HOST_URL) >> .env && \
echo PORT=$(cat /run/secrets/PORT) >> .env'

CMD ["npm", "start"]
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Bot

## How to use image?

Example `docker-compose.yaml`
```
version: '3'
services:
dishdash-bot:
image: shampiniony/dishdash-bot:latest
environment:
- API_URL=${API_URL}
- BOT_TOKEN=${BOT_TOKEN}
- BOT_URL=${BOT_URL}
- BOT_USERNAME=${BOT_USERNAME}
- DEVELOP=${DEVELOP}
- FRONTEND_URL=${FRONTEND_URL}
- HOST_URL=${HOST_URL}
- PORT=${PORT}
```

0 comments on commit 5834022

Please sign in to comment.