-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (31 loc) · 970 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
37
38
39
40
41
FROM python:3.10.7-slim-bullseye
EXPOSE 8000
ARG token
ARG host
ARG database
ARG user
ARG password
ENV PYTHONPATH /app
ENV DEBIAN_FRONTEND=noninteractive
# install jdk 8, for jdbc driver
# this is required for remote connection
# gcc and g++ are rquired to compile the api for jdbc library
RUN mkdir -p /usr/share/man/man1 /usr/share/man/man2
RUN apt-get update && \
apt-get install -y --no-install-recommends \
openjdk-11-jre gcc g++
# Prints installed java version, just for checking
RUN java --version
WORKDIR /app/
COPY ./requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY ./src/ ./src/
COPY ./entrypoint.sh .
COPY ./postgresql-42.4.0.jar .
COPY ./preset.json .
COPY Config.py .
COPY main.py .
COPY server_setting.json .
# generate the secret config
RUN echo "[server]\n token= ${token}\n[database]\n host = ${host}\n database = ${database}\n user = ${user}\n password = ${password}">secret.cfg
ENTRYPOINT ./entrypoint.sh