diff --git a/Dockerfile b/Dockerfile index eeb5b9e..d993991 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,46 @@ -FROM python:3.7.2-alpine3.9 +FROM python:3.7.2-stretch -RUN echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories -RUN apk add --update --no-cache ca-certificates gcc g++ curl openblas-dev@community -RUN ln -s /usr/include/locale.h /usr/include/xlocale.h +#Code Remote Plugin is not compatible with alpine :( +#RUN echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories +#RUN apk add --update --no-cache ca-certificates gcc g++ curl openblas-dev@community +#RUN ln -s /usr/include/locale.h /usr/include/xlocale.h -WORKDIR /usr/src/LEDServer RUN pip3 install --upgrade pip -RUN pip3 install --no-cache-dir numpy -RUN pip3 install --no-cache-dir pylint -RUN pip3 install --no-cache-dir RPi.GPIO +# Python Development Tools RUN pip3 install --no-cache-dir --upgrade ptvsd -# RUN pip3 install --no-cache-dir scipy # scipy is only required by the recorder application +RUN pip3 install --no-cache-dir pylint +RUN pip3 install --no-cache-dir mypy + +# Just to get a message that this is not a raspberry pi +RUN pip3 install --no-cache-dir RPi.GPIO + +# Pulseaudio for the audiorecorder development +RUN pip3 install git+https://github.com/GeorgeFilipkin/pulsemixer.git +ENV UNAME pacat + +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install --yes pulseaudio +RUN DEBIAN_FRONTEND=noninteractive apt-get install --yes alsa-utils +RUN adduser root audio +RUN adduser root pulse-access + + RUN echo "load-module module-native-protocol-tcp port=34567 auth-anonymous=1" >> /etc/pulse/system.pa +#Not sure if this is needed for audiorecorder +#RUN pip3 install --no-cache-dir scipy +#defenetly needed for audio recorder, also the musicEffect +RUN pip3 install --no-cache-dir numpy +# pyaudio to record audio +RUN DEBIAN_FRONTEND=noninteractive apt-get install --yes portaudio19-dev +RUN pip3 install --no-cache-dir pyaudio +RUN pip3 install --no-cache-dir matplotlib + + + +# import my ssh key to be able to use github +RUN mkdir ~/.ssh && \ + ln -s /run/secrets/host_ssh_key ~/.ssh/id_rsa && \ + ssh-keyscan github.com >> ~/.ssh/known_hosts + +#CMD ["pacat", "-vvvv", "/dev/urandom"] +CMD exec /bin/bash -c "trap : TERM INT; sleep infinity & wait" diff --git a/docker-compose.yml b/docker-compose.yml index 6da18ec..32fbdb9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,27 +1,49 @@ -version: '3' +version: '3.1' services: ledserver-controller-html: build: clients/controller-html ports: - "8080:80" - image: ledserver-controller-html - rpi_udp_client: - build: clients/strip-rpi-udp - #ports: - image: rpi-udp-client - ledserver: - build: server + image: ledserver_controller-html + #rpi_udp_client: + # build: clients/strip-rpi-udp + # #ports: + # image: ledserver_rpi-udp-client + #ledserver: + # build: server + # #ports: + # # - "8001:8001" + # # - "8002:8002/udp" + # network_mode: host #docker is changing the source port of the udp packages on the bridge + # image: ledserver_server + # #user: "${UID}:${GID}" + # #volumes: + # # - ./server:/usr/src/server + # #command: python3.7 /usr/src/server/LEDServer.py + python-devel: + build: . + image: ledserver_python-devel #ports: # - "8001:8001" # - "8002:8002/udp" + # - "4832:34567" network_mode: host #docker is changing the source port of the udp packages on the bridge - image: ledserver - #user: "${UID}:${GID}" - #volumes: - # - ./server:/usr/src/server - #command: python3.7 /usr/src/server/LEDServer.py - devel: - build: . - image: devel + volumes: + - ./:/app + - /tmp/.X11-unix:/tmp/.X11-unix + secrets: + - host_ssh_key + - host_ssh_known_hosts + - host_ssh_config + environment: + - DISPLAY=unix:0 + +secrets: + host_ssh_key: + file: ~/.ssh/id_rsa + host_ssh_known_hosts: + file: ~/.ssh/known_hosts + host_ssh_config: + file: ~/.ssh/config