FirstLegoLeague / launcher

A launcher program to install and launch all the micro-services of the system
GNU General Public License v3.0
9 stars 15 forks source link

Create a Docker container for the launcher #172

Open rovitotv opened 4 years ago

rovitotv commented 4 years ago

I am trying to create a docker container with the launcher software in it so it could run on Linux, Mac, and Windows. Currently I am having difficulty getting the software to build correctly. It appears that the command 'yarn get all' fails with a non-zero exit code and I can't seem to figure out why. I also think maybe MongoDB needs to be listed as a dependency in the README? I support two FLL tournaments and for now I can use the Windows installer but I would much rather have a Linux version. Thanks for the assistance!

# Dockerfile for FLL scoring software
FROM ubuntu:18.04

MAINTAINER rovitotv@gmail.com

RUN apt-get -y update
RUN apt-get install -y curl wget git libgtk2.0-0 libgtkextra-dev libgconf2-dev libnss3 libasound2 libxtst-dev libxss1 vim
RUN apt-get install -y build-essential
RUN apt-get install -y x11-apps
RUN apt-get install -y libgtk-3-0
RUN apt-get install -y libx11-xcb1

# nodejs
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get -y update
RUN apt install -y nodejs

# yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get -y update
RUN apt-get install -y yarn

# download the FLL launcher
WORKDIR /usr/local
RUN git clone https://github.com/FirstLegoLeague/launcher.git
RUN yarn --version

# build the FLL launcher
WORKDIR /usr/local/launcher
RUN yarn install
RUN yarn get all # this command creates a non-zero exit code

# install MongoDB
WORKDIR /tmp
RUN mkdir /usr/local/launcher/internals
RUN mkdir /usr/local/launcher/internals/mongo
RUN curl https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.2.1.tgz -o /tmp/mongodb-linux-x86_64-ubuntu1804-4.2.1.tgz && \
    tar -zxvf mongodb-linux-*-4.2.1.tgz && \
    cd mongodb-linux-x86_64-ubuntu1804-4.2.1/ && \
    cp -av bin /usr/local/launcher/internals/mongo/

# run the launcher
WORKDIR /usr/local/launcher
#node ./node_modules/.bin/electron app/main.js
CMD ["yarn", "start"]

expose 8080