-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
44 lines (36 loc) · 1.31 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
FROM osrf/ros:humble-desktop as base
ENV rosdistro=humble
ARG OPENAI_API_KEY
ENV OPENAI_API_KEY=$OPENAI_API_KEY
SHELL ["/bin/bash", "-c"]
RUN sudo apt-get update \
&& apt-get install -y \
libespeak-dev \
python3-pip \
wget curl unzip \
lsb-release \
mesa-utils \
build-essential \
apt-utils
# Create colcon workspace with dependencies
RUN mkdir /ros2_ws
COPY ./src /ros2_ws/src
COPY ./requirements.txt /ros2_ws/requirements.txt
# Install python dependencies
RUN pip3 install -r /ros2_ws/requirements.txt
# Set up rosdep
WORKDIR /ros2_ws
RUN source /opt/ros/humble/setup.bash \
&& rosdep update \
&& rosdep install --rosdistro $rosdistro --from-paths src --ignore-src -r -y \
&& colcon build --symlink-install
EXPOSE 5000
# Create a script to run the Flask app
RUN echo "#!/bin/bash" > /ros2_ws/start_flask_app.sh
RUN echo "source install/setup.sh" >> /ros2_ws/start_flask_app.sh
RUN echo "ros2 run rosgpt rosgpt &" >> /ros2_ws/start_flask_app.sh
RUN echo "ros2 run rosgpt rosgpt_client_node &" >> /ros2_ws/start_flask_app.sh
RUN echo "ros2 run rosgpt rosgptparser_drone &" >> /ros2_ws/start_flask_app.sh
RUN echo "ros2 launch sjtu_drone_bringup sjtu_drone_bringup.launch.py" >> /ros2_ws/start_flask_app.sh
RUN chmod +x /ros2_ws/start_flask_app.sh
ENTRYPOINT ["/ros2_ws/start_flask_app.sh"]