-
Notifications
You must be signed in to change notification settings - Fork 133
/
Copy pathDockerfile
63 lines (61 loc) · 2.43 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
53
54
55
56
57
58
59
60
61
62
63
# Copyright (c) 2020, 2024, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
FROM oraclelinux:8
ARG BRANCH=master
LABEL "provider"="Oracle" \
"issues"="https://github.com/oracle/oci-designer-toolkit/issues" \
"version"="0.66.1" \
"description"="OKIT Web Server Container." \
"copyright"="Copyright (c) 2020, 2024, Oracle and/or its affiliates."
# SHELL ["/bin/bash", "-c"]
ENV PYTHONIOENCODING=utf8 \
PYTHONPATH=":/okit/visualiser:/okit/okitweb:/okit" \
FLASK_APP=okitweb \
FLASK_DEBUG=1 \
LANG=en_GB.UTF-8 \
LANGUAGE=en_GB:en \
LC_ALL=en_GB.UTF-8 \
PATH=/root/bin:${PATH}
# Expose Ports
EXPOSE 80
EXPOSE 443
# Copy source code
# COPY containers/oci/* /root/.oci/
# COPY containers/docker/run-server.sh /root/bin/
# Install new yum repos
RUN yum install -y \
oraclelinux-developer-release-el8 \
# Update base image
&& yum update -y \
# Install additional packages
&& yum install -y \
git \
openssl \
python38 \
python3-pip \
&& rm -rf /var/cache/yum \
&& alternatives --set python3 /usr/bin/python3.8 \
# Configure ssh
&& echo 'Host *' > /etc/ssh/ssh_config \
&& echo ' StrictHostKeyChecking no' >> /etc/ssh/ssh_config \
&& echo ' UserKnownHostsFile=/dev/null' >> /etc/ssh/ssh_config \
# Upgrade pip
&& python3 -m pip install --upgrade pip \
# Create Workspace
&& mkdir -p /github \
&& echo "Branch: $BRANCH" \
&& git clone --branch $BRANCH --single-branch \
--config core.autocrlf=input \
https://github.com/oracle/oci-designer-toolkit.git /github/oci-designer-toolkit \
&& mkdir -p /okit/{git,local,log,instance/git,instance/local,instance/templates/user,workspace,ssl} \
&& mkdir -p /root/bin \
&& ln -sv /github/oci-designer-toolkit/config /okit/config \
&& ln -sv /github/oci-designer-toolkit/okitweb /okit/okitweb \
&& ln -sv /github/oci-designer-toolkit/visualiser /okit/visualiser \
&& ln -sv /github/oci-designer-toolkit/containers/docker/run-server.sh /root/bin/run-server.sh \
&& ln -sv /github/oci-designer-toolkit/okitweb/static/okit/templates/reference_architecture /okit/instance/templates/reference_architecture \
&& chmod a+x /root/bin/run-server.sh \
# Install required python modules
&& python3 -m pip install --no-cache-dir -r /github/oci-designer-toolkit/requirements.txt
# Add entrypoint to automatically start webserver
CMD ["run-server.sh"]