-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDemo.Dockerfile
45 lines (27 loc) · 1.12 KB
/
Demo.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
# Stage 1: build frontend ui
FROM mcr.microsoft.com/cbl-mariner/base/nodejs:16 as ui-build
COPY ./palantir_ui /usr/src/palantir_ui
WORKDIR /usr/src/palantir_ui
RUN npm install && npm run build
# Stage 2: build backend and start nginx to as reserved proxy for both ui and backend
FROM mcr.microsoft.com/devcontainers/python:dev-3.9
COPY ./palantir_api /usr/src/palantir_api
WORKDIR /usr/src/palantir_api
RUN pip install -r requirements.txt
RUN apt-get update -y && apt-get install -y sqlite3 nginx openssh-server
COPY ./deploy/nginx.conf /etc/nginx/nginx.conf
COPY --from=ui-build /usr/src/palantir_ui/build /usr/share/nginx/html
RUN echo "root:Docker!" | chpasswd
# Copy the sshd_config file to the /etc/ssh/ directory
COPY sshd_config /etc/ssh/
# Copy and configure the ssh_setup file
RUN mkdir -p /tmp
COPY ssh_setup.sh /tmp
RUN chmod +x /tmp/ssh_setup.sh \
&& (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null)
# Open port 2222 for SSH access
EXPOSE 80 2222 8000
# Start web server
COPY ./deploy/start.sh .
RUN ["chmod", "+x", "./start.sh"]
CMD ["/bin/sh", "-c", "./start.sh"]