Jelajahi Sumber

changed config to happen on startup

Spencer Gardner 8 tahun lalu
induk
melakukan
d5affac6ea
1 mengubah file dengan 4 tambahan dan 5 penghapusan
  1. 4 5
      Dockerfile

+ 4 - 5
Dockerfile

@@ -10,17 +10,16 @@ RUN git clone https://github.com/tpaskett/meshchat.git
 
 
 WORKDIR /root/meshchat
 WORKDIR /root/meshchat
 
 
-RUN sed -i 's|.*$pi_zone.*|our $pi_zone = $ENV{"ZONE"};|' src/pi/data/www/cgi-bin/meshchatconfig.pm
-RUN sed -i 's|.*$local_meshchat_node.*|our $local_meshchat_node  = $ENV{"LOCAL_NODE"};|' src/pi/data/www/cgi-bin/meshchatconfig.pm
-
 RUN ./build
 RUN ./build
 RUN dpkg -i meshchat_1.0_all.deb
 RUN dpkg -i meshchat_1.0_all.deb
 
 
 EXPOSE 80
 EXPOSE 80
 
 
-ENV ZONE=MeshChat
+ENV MESH_ZONE=MeshChat
 ENV LOCAL_NODE=localnode
 ENV LOCAL_NODE=localnode
 
 
 VOLUME ["/var/www/html/meshchat/db/"]
 VOLUME ["/var/www/html/meshchat/db/"]
 
 
-CMD echo nameserver $LOCAL_NODE > /etc/resolv.conf && apache2ctl start && meshchatsync
+CMD sed -i 's|.*$pi_zone.*|our $pi_zone = '"\"$MESH_ZONE\";|" /usr/lib/cgi-bin/meshchatconfig.pm  && \
+ sed -i 's|.*$local_meshchat_node.*|our $$local_meshchat_node = '"\"$LOCAL_NODE\";|" /usr/lib/cgi-bin/meshchatconfig.pm && \
+ echo nameserver $LOCAL_NODE > /etc/resolv.conf && apache2ctl start && meshchatsync