-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (39 loc) · 1.4 KB
/
Dockerfile
File metadata and controls
50 lines (39 loc) · 1.4 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
## Build stage
FROM python:3.14-alpine AS build-stage
# set environment
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PATH="/app/venv/bin:$PATH"
# set venv and copy requirements
RUN python -m venv /app/venv
COPY requirements.txt .
# install packages
RUN pip install --no-cache-dir -r requirements.txt
## Runtime stage
FROM python:3.14-alpine AS runtime-stage
# set labels
ARG BUILD_DATE
ARG VERSION
LABEL org.opencontainers.image.authors="tibynx (https://github.com/tibynx)"
LABEL org.opencontainers.image.created="${BUILD_DATE}"
LABEL org.opencontainers.image.version="${VERSION}"
LABEL org.opencontainers.image.title="Orbit"
LABEL org.opencontainers.image.description="A simple, feature-rich Discord bot designed to bring fun, utility, and entertainment to your server."
LABEL org.opencontainers.image.source="https://github.com/tibynx/orbit"
LABEL org.opencontainers.image.url="https://github.com/tibynx/orbit/packages"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.base.name="python:3.14-alpine"
LABEL org.opencontainers.image.base.documentation="https://hub.docker.com/_/python"
# set environment
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PATH="/app/venv/bin:$PATH"
# copy files from build-stage
COPY --from=build-stage /app/venv /app/venv
COPY . .
# set volume for logs
VOLUME ["/app/logs"]
# run the app
CMD ["python", "main.py"]