<commit_before>FROM resin/rpi-raspbian

# Install all required packages
RUN apt-get update && apt-get install git iproute2 swig libftdi-dev python-dev build-essential iputils-ping WiringPi

# Get the code for the ic880a-gateway
RUN git clone -b spi https://github.com/ttn-zh/ic880a-gateway.git ~/ic880a-gateway

ENV INSTALL_DIR /opt/ttn-gateway
RUN git clone https://github.com/devttys0/libmpsse.git $INSTALL_DIR/libmpsse
WORKDIR $INSTALL_DIR/libmpsse/src
RUN ./configure --disable-python
RUN make
RUN make install
RUN ldconfig

RUN git clone https://github.com/TheThingsNetwork/lora_gateway.git $INSTALL_DIR/lora_gateway

RUN cp $INSTALL_DIR/lora_gateway/libloragw/99-libftdi.rules /etc/udev/rules.d/99-libftdi.rules
RUN sed -i -e 's/PLATFORM= kerlink/PLATFORM= imst_rpi/g' $INSTALL_DIR/lora_gateway/libloragw/library.cfg

WORKDIR $INSTALL_DIR/lora_gateway
RUN make

RUN git clone https://github.com/TheThingsNetwork/packet_forwarder.git $INSTALL_DIR/packet_forwarder
WORKDIR $INSTALL_DIR/packet_forwarder 
RUN make
RUN mkdir $INSTALL_DIR/bin
RUN ln -s $INSTALL_DIR/packet_forwarder/poly_pkt_fwd/poly_pkt_fwd $INSTALL_DIR/bin/poly_pkt_fwd
RUN cp -f $INSTALL_DIR/packet_forwarder/poly_pkt_fwd/global_conf.json $INSTALL_DIR/bin/global_conf.json

ENV GATEWAY_EUI B827EBFFFE906B07
ENV GATEWAY_LAT 47.8
ENV GATEWAY_LON 8.1
ENV GATEWAY_ALT 400
ENV GATEWAY_EMAIL <EMAIL> 
ENV GATEWAY_NAME NCA_ZH_1
RUN echo "{\n\t\"gateway_conf\": {\n\t\t\"gateway_ID\": \"${GATEWAY_EUI}\",\n\t\t\"servers\": [ { \"server_address\": \"router.eu.thethings.network\", \"serv_port_up\": 1700, \"serv_port_down\": 1700, \"serv_enabled\": true } ], \n\t\t\"ref_latitude\": ${GATEWAY_LAT},\n\t\t\"ref_longitude\": ${GATEWAY_LON},\n\t\t\"ref_altitude\": ${GATEWAY_ALT},\n\t\t\"contact_email\": \"${GATEWAY_EMAIL}\",\n\t\t\"description\": \"${GATEWAY_NAME}\"  \n\t}\n}" > $INSTALL_DIR/bin/local_conf.json
RUN cat $INSTALL_DIR/bin/local_conf.json
RUN cp ~/ic880a-gateway/start.sh $INSTALL_DIR/bin/
RUN sed -i -e 's/SX1301_RESET_BCM_PIN=25/SX1301_RESET_BCM_PIN=17/g' $INSTALL_DIR/bin/start.sh
CMD $INSTALL_DIR/bin/start.sh
<commit_msg>Fixed location of started service<commit_after>FROM resin/rpi-raspbian

# Install all required packages
RUN apt-get update && apt-get install git iproute2 swig libftdi-dev python-dev build-essential iputils-ping WiringPi

# Get the code for the ic880a-gateway
RUN git clone -b spi https://github.com/ttn-zh/ic880a-gateway.git ~/ic880a-gateway

ENV INSTALL_DIR /opt/ttn-gateway
RUN git clone https://github.com/devttys0/libmpsse.git $INSTALL_DIR/libmpsse
WORKDIR $INSTALL_DIR/libmpsse/src
RUN ./configure --disable-python
RUN make
RUN make install
RUN ldconfig

RUN git clone https://github.com/TheThingsNetwork/lora_gateway.git $INSTALL_DIR/lora_gateway

RUN cp $INSTALL_DIR/lora_gateway/libloragw/99-libftdi.rules /etc/udev/rules.d/99-libftdi.rules
RUN sed -i -e 's/PLATFORM= kerlink/PLATFORM= imst_rpi/g' $INSTALL_DIR/lora_gateway/libloragw/library.cfg

WORKDIR $INSTALL_DIR/lora_gateway
RUN make

RUN git clone https://github.com/TheThingsNetwork/packet_forwarder.git $INSTALL_DIR/packet_forwarder
WORKDIR $INSTALL_DIR/packet_forwarder 
RUN make
RUN mkdir $INSTALL_DIR/bin
RUN ln -s $INSTALL_DIR/packet_forwarder/poly_pkt_fwd/poly_pkt_fwd $INSTALL_DIR/bin/poly_pkt_fwd
RUN cp -f $INSTALL_DIR/packet_forwarder/poly_pkt_fwd/global_conf.json $INSTALL_DIR/bin/global_conf.json

ENV GATEWAY_EUI B827EBFFFE906B07
ENV GATEWAY_LAT 47.8
ENV GATEWAY_LON 8.1
ENV GATEWAY_ALT 400
ENV GATEWAY_EMAIL <EMAIL> 
ENV GATEWAY_NAME NCA_ZH_1
RUN echo "{\n\t\"gateway_conf\": {\n\t\t\"gateway_ID\": \"${GATEWAY_EUI}\",\n\t\t\"servers\": [ { \"server_address\": \"router.eu.thethings.network\", \"serv_port_up\": 1700, \"serv_port_down\": 1700, \"serv_enabled\": true } ], \n\t\t\"ref_latitude\": ${GATEWAY_LAT},\n\t\t\"ref_longitude\": ${GATEWAY_LON},\n\t\t\"ref_altitude\": ${GATEWAY_ALT},\n\t\t\"contact_email\": \"${GATEWAY_EMAIL}\",\n\t\t\"description\": \"${GATEWAY_NAME}\"  \n\t}\n}" > $INSTALL_DIR/bin/local_conf.json
RUN cat $INSTALL_DIR/bin/local_conf.json
RUN cp ~/ic880a-gateway/start.sh $INSTALL_DIR/bin/
RUN sed -i -e 's/SX1301_RESET_BCM_PIN=25/SX1301_RESET_BCM_PIN=17/g' $INSTALL_DIR/bin/start.sh
WORKDIR $INSTALLDIR/bin
CMD ./start.sh

{'fraction_non_alphanumeric': 0.1410347271438696, 'fraction_numerical': 0.025986298133711314, 'mean_word_length': 5.100864553314121, 'pattern_counts': {'":': 24, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1810442', 'n_tokens_mistral': 1815, 'n_tokens_neox': 1724, 'n_words': 304}