Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimzed Dockerfile #48

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
# official Python runtime as a base image
# Use the official Python runtime as a base image
FROM python:3.12.1-slim-bookworm

# Set the working directory
# Set the working directory inside the container
WORKDIR /ABSBOT

# Copy the current directory contents
COPY Scripts/ /ABSBOT


# Install any needed packages specified in requirements.txt
RUN pip install discord.py-interactions[voice]
RUN pip install --trusted-host pypi.python.org -r requirements.txt
# Copy requirements file
COPY Scripts/requirements.txt /ABSBOT/requirements.txt

# Install needed packages specified in requirements.txt
RUN pip install discord.py-interactions[voice] \
&& pip install --trusted-host pypi.python.org -r requirements.txt

# Install dependencies (ffmpeg, libffi, etc.)
RUN set -ex \
&& apt-get update \
&& apt-get install -y ffmpeg \
&& apt-get install -y libffi-dev libnacl-dev \
&& apt-get install -y ffmpeg libffi-dev libnacl-dev \
&& apt-get upgrade -y \
&& apt-get autoremove -y \
&& apt-get clean -y
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

# Copy the rest of the application code
COPY Scripts/ /ABSBOT

# Health check
HEALTHCHECK --interval=1m --timeout=10s --retries=1 \
CMD python3 healthcheck.py

CMD python3 healthcheck.py || exit 1

# Set the default command
CMD ["python", "main.py"]

Loading