feat: Reimplement the deployment process through Docker
Some checks failed
CI / Run tests (pull_request) Has been cancelled
Some checks failed
CI / Run tests (pull_request) Has been cancelled
This commit is contained in:
35
Dockerfile
35
Dockerfile
@@ -1,19 +1,36 @@
|
||||
FROM python:3.13.14-alpine
|
||||
|
||||
RUN apk add --no-cache \
|
||||
build-base \
|
||||
libffi-dev \
|
||||
musl-dev \
|
||||
openssl-dev \
|
||||
python3-dev \
|
||||
geckodriver \
|
||||
firefox-esr
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt && \
|
||||
apk add --no-cache firefox geckodriver
|
||||
|
||||
COPY . .
|
||||
|
||||
ENV TOKEN=""
|
||||
ENV URL=""
|
||||
ENV CONFIG_PATH="/config"
|
||||
ENV COGS=""
|
||||
ENV GECKODRIVER_PATH="/usr/bin/geckodriver"
|
||||
|
||||
RUN mkdir ${CONFIG_PATH}
|
||||
RUN adduser -D bot && \
|
||||
mkdir /logs && \
|
||||
chown -R bot:bot /logs && \
|
||||
chmod 755 /logs && \
|
||||
mkdir -p ${CONFIG_PATH} && \
|
||||
chown -R bot:bot ${CONFIG_PATH} && \
|
||||
chmod 755 ${CONFIG_PATH}
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
RUN chown -R bot:bot /app && \
|
||||
chmod -R 755 /app && \
|
||||
chmod +x /app/main.py
|
||||
|
||||
USER bot
|
||||
|
||||
ENTRYPOINT ["python", "main.py"]
|
||||
Reference in New Issue
Block a user