diff --git a/Dockerfile b/Dockerfile index c72ed1e..d327d13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,16 +6,16 @@ WORKDIR /app # Install dependencies COPY pyproject.toml poetry.lock ./ -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 \ +RUN pip install poetry \ && poetry config virtualenvs.create false \ && poetry install --no-dev # Copy the rest of the application code COPY . . +# Define environment variables from secrets +RUN echo "GUILD_ID=$(cat /run/secrets/GUILD_ID)" >> /etc/environment \ + && echo "BOT_TOKEN=$(cat /run/secrets/BOT_TOKEN)" >> /etc/environment + # Run the bot CMD ["poetry", "run", "python", "src/main.py"]