-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (15 loc) · 952 Bytes
/
Dockerfile
File metadata and controls
23 lines (15 loc) · 952 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM python:3.13-alpine as base
RUN pip install --upgrade pip
RUN apk --update add gcc musl-dev postgresql-dev git
COPY . /app
WORKDIR /app
RUN pip install -r requirements.txt
FROM base as development
CMD ["./wait-for", "postgres:5432", "--", "python", "src/kubot.py"]
FROM base as production
ARG TARGETPLATFORM
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ] ; then wget -O /usr/local/lib/python3.8/site-packages/pyarmor/platforms/linux/x86_64/_pytransform.so http://pyarmor.dashingsoft.com/downloads/latest/alpine/_pytransform.so ; fi
RUN if [ "$TARGETPLATFORM" = "linux/arm/v7" ] ; then mkdir -p /root/.pyarmor/platforms/linux/armv7/3/ && wget -O /root/.pyarmor/platforms/linux/armv7/3/_pytransform.so http://pyarmor.dashingsoft.com/downloads/latest/alpine.arm/_pytransform.so ; fi
RUN pyarmor obfuscate --exclude venv --exclude tests --recursive src/kubot.py
RUN rm -rf src
CMD ["./wait-for", "postgres:5432", "--", "python", "dist/kubot.py"]