-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
52 lines (38 loc) · 1.39 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
# ==============================================================================
# Build stage
# ARG IMAGE=intersystemsdc/iris-community:latest
ARG IMAGE=intersystemsdc/iris-community:2024.1-zpm
FROM $IMAGE
WORKDIR /irisdev/app
# Define args for environment variables
ARG IRISUSERNAME
ARG IRISPASSWORD
ARG IRISNAMESPACE
# Set environment variables from args
ENV IRISUSERNAME=${IRISUSERNAME}
ENV IRISPASSWORD=${IRISPASSWORD}
ENV IRISNAMESPACE=${IRISNAMESPACE}
ENV ISC_PACKAGE_INITIAL_SECURITY "Locked Down"
ENV ISC_PACKAGE_USER_PASSWORD "secretpassword"
ENV PYTHON_PATH=/usr/irissys/bin/
ENV LD_LIBRARY_PATH=${ISC_PACKAGE_INSTALLDIR}/bin:${LD_LIBRARY_PATH}
ENV PATH "/home/irisowner/.local/bin:/usr/irissys/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/irisowner/bin"
COPY . .
# Update pip, setuptools, and wheel
RUN pip3 install --upgrade pip setuptools wheel
# Clear pip cache
RUN pip3 cache purge
# Install the required Python packages
RUN pip3 install -r requirements.txt --verbose
# ==============================================================================
# Production stage
ENV INIT_PATH=./init.sh
# Copy the init script and make it executable
COPY init.sh $INIT_PATH
# Switch to root to change permissions
USER root
RUN chmod +x $INIT_PATH
# Switch back to the original user
USER irisowner
# Set the entrypoint to the init.sh script
ENTRYPOINT ["sh", "-c", "$INIT_PATH"]