75 lines
2.3 KiB
Docker
75 lines
2.3 KiB
Docker
# syntax=docker/dockerfile:1
|
|
|
|
# Comments are provided throughout this file to help you get started.
|
|
# If you need more help, visit the Dockerfile reference guide at
|
|
# https://docs.docker.com/go/dockerfile-reference/
|
|
|
|
# Want to help us make this template better? Share your feedback here: https://forms.gle/ybq9Krt8jtBL3iCk7
|
|
|
|
ARG PYTHON_VERSION=3.11.5
|
|
FROM ubuntu:latest AS base
|
|
|
|
# Prevents Python from writing pyc files.
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
|
|
# Keeps Python from buffering stdout and stderr to avoid situations where
|
|
# the application crashes without emitting any logs due to buffering.
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
# Set timezone in the container
|
|
ENV TZ="America/Detroit"
|
|
|
|
WORKDIR /app
|
|
|
|
# Create a non-privileged user that the app will run under.
|
|
# See https://docs.docker.com/go/dockerfile-user-best-practices/
|
|
# ARG UID=10001
|
|
# RUN useradd appuser
|
|
|
|
# update package list
|
|
RUN apt-get update
|
|
|
|
# install wget
|
|
|
|
# install python, pipx
|
|
RUN apt-get install -y wget python3 pipx
|
|
|
|
# install latest conda
|
|
# ENV PATH="/root/miniconda3/bin:${PATH}"
|
|
# ARG PATH="/root/miniconda3/bin:${PATH}"
|
|
# RUN arch=$(uname -m) && \
|
|
# if [ "$arch" = "x86_64" ]; then \
|
|
# MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"; \
|
|
# elif [ "$arch" = "aarch64" ]; then \
|
|
# MINICONDA_URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-aarch64.sh"; \
|
|
# else \
|
|
# echo "Unsupported architecture: $arch"; \
|
|
# exit 1; \
|
|
# fi && \
|
|
# wget $MINICONDA_URL -O miniconda.sh && \
|
|
# mkdir -p /root/.conda && \
|
|
# bash miniconda.sh -b -p /root/miniconda3 && \
|
|
# rm -f miniconda.sh
|
|
|
|
# Copy the source code into the container.
|
|
COPY . .
|
|
|
|
# RUN conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/main && \
|
|
# conda tos accept --override-channels --channel https://repo.anaconda.com/pkgs/r
|
|
|
|
# RUN conda env create -f ./environment.yml
|
|
|
|
# SHELL ["conda", "run", "-n", "very-bad", "/bin/bash", "-c"]
|
|
|
|
# Switch to the non-privileged user to run the application.
|
|
|
|
# install poetry via pipx
|
|
RUN pipx install poetry && pipx ensurepath
|
|
RUN ~/.local/bin/poetry install
|
|
|
|
|
|
# Expose the port that the application listens on.
|
|
EXPOSE 8000
|
|
|
|
CMD ~/.local/bin/poetry run python src/bot_core.py database.ini discord.token 1128111628471255050 1441504341797371996
|