-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathDockerfile.local
31 lines (22 loc) · 952 Bytes
/
Dockerfile.local
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
# This Dockerfile.local can built with the following command:
# > docker build -f Dockerfile.local -t java-codegen-local-dev .
# where the 'java-codegen-local-dev' is the name of the image that will be created.
FROM python:3.11-alpine
RUN apk add --no-cache build-base python3-dev linux-headers openjdk11
COPY requirements.txt requirements.txt
ENV VIRTUAL_ENV=/opt/venv
RUN sh -c "python -m venv ${VIRTUAL_ENV} && \
. ${VIRTUAL_ENV}/bin/activate && \
python -m pip install --upgrade pip && \
python -m pip install --no-cache-dir -r requirements.txt"
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk
ENV PATH=${VIRTUAL_ENV}/bin:${JAVA_HOME}/bin:${PATH}
ENV HOME=/opt
ENV CODE_DIR=/opt/code
ENV ADDRESS=0.0.0.0:8080
# This makes print statements show up in the logs API
ENV WITH_ERROR_SERVER=1 \
PYTHONUNBUFFERED=1
COPY ./*.sh ${CODE_DIR}/
WORKDIR ${CODE_DIR}
ENTRYPOINT ["sh", "-c", "exec ${CODE_DIR}/start_server.sh \"$@\"", "--"]