Skip to content

Commit

Permalink
chore(ci): Update docker file to use environment variable properly
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenixpereira committed Jun 5, 2024
1 parent 275d7d0 commit 9459f1f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ celerybeat.pid

# Environments
.env
.env.local
.venv
env/
venv/
Expand Down
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ WORKDIR /app
# Install dependencies
COPY pyproject.toml poetry.lock ./

RUN pip install --upgrade pip \
RUN --mount=type=secret,id=GUILD_ID,target=/run/secrets/GUILD_ID \
--mount=type=secret,id=BOT_TOKEN,target=/run/secrets/BOT_TOKEN \
GUILD_ID=$(cat /run/secrets/GUILD_ID) \
BOT_TOKEN=$(cat /run/secrets/BOT_TOKEN) \
&& pip install poetry \
&& poetry config virtualenvs.create false \
&& poetry install --no-dev

# Copy the rest of the application code
COPY . .

# Environment variables
ENV GUILD_ID=GUILD_ID
ENV BOT_TOKEN=BOT_TOKEN

# Run the bot
CMD ["poetry", "run", "python", "src/main.py"]
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
image: duckbot:latest
container_name: duckbot
env_file:
- .env.local
- .env
environment:
- PUID=1000
- PGID=1000
Expand Down

0 comments on commit 9459f1f

Please sign in to comment.