-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
55 lines (42 loc) · 1.41 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
# Argument for base image (default: slim)
ARG BASEIMAGE="debian-slim"
## Base image using Debian
FROM python:3.10 AS debian
# Update/upgrade packages
RUN apt-get update && apt-get upgrade -y
## Base image using slim Debian
FROM python:3.10-slim AS debian-slim
# Update/upgrade packages
RUN apt-get update && apt-get upgrade -y
## Ricardo-Backend image
FROM $BASEIMAGE
# Create backend directory
RUN mkdir /ricardo-backend
# Move to backend directory
WORKDIR /ricardo-backend
# Copy Python requirements file to allow for caching of the pip3 install command
COPY ./requirements.txt ./requirements.txt
# Install Python requirements
RUN pip3 install -r ./requirements.txt
# Copy backend files
COPY ./external/pylibrnp ./external/pylibrnp
COPY ./Logs ./Logs
COPY ./ricardobackend ./ricardobackend
COPY ./main.py ./main.py
COPY ./RicardoBackend.sh ./RicardoBackend.sh
# Make the backend script executable
RUN chmod +x ./RicardoBackend.sh
# Set default values for environment variables
# TODO: set default device
ENV RICARDO_BACKEND_DEVICE=/dev/null
ENV RICARDO_BACKEND_BAUD=115200
ENV RICARDO_BACKEND_FLASK_HOST=0.0.0.0
ENV RICARDO_BACKEND_FLASK_PORT=1337
ENV RICARDO_BACKEND_MONITOR=FALSE
ENV RICARDO_BACKEND_MONITOR_IP=127.0.0.1
ENV RICARDO_BACKEND_MONITOR_PORT=7000
ENV RICARDO_BACKEND_WS_PORT=1338
ENV RICARDO_BACKEND_WS_HOST=0.0.0.0
ENV RICARDO_BACKEND_FAKE_DATA=FALSE
# Run backend script
ENTRYPOINT [ "bash", "RicardoBackend.sh" ]