-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (27 loc) · 1023 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM python:3.10-slim-bullseye
# ref: https://hub.docker.com/_/python
COPY requirements.txt /bot/
ARG REPO_DIR
WORKDIR /bot
# below might not be required if switched to headless install for opencv
RUN apt-get update && apt-get install --no-install-recommends -y git libgl1 libglib2.0-0 libsm6 libxrender1 libxext6
# Create directory for docs and clone repo
RUN mkdir ~/${REPO_DIR}
RUN git -C ~/repo_data clone https://github.com/ultralytics/ultralytics.git
# Install app requirements
RUN pip install -r requirements.txt
COPY . .
CMD ["python3", "src/bot.py"]
# Dockerfile ref: https://www.pythondiscord.com/pages/guides/python-guides/docker-hosting-guide/
# BUILD
# cd /path/to/project
# sudo docker build -t ubot .
# RUN
# sudo docker run -d --name ultrabot ubot:latest
# VIEW LOGS
# sudo docker logs -f ultrabot
# VIEW CONTAINER FILES (not recommended)
# sudo docker exec -it ultrabot bash
# TEST BUILD
# sudo docker build -t ubot2 . --build-arg REPO_DIR=repo_data
# sudo docker run -d --name ubot2 ubot2:latest