add docker and docker-compose files

This commit is contained in:
Peter Buchegger 2022-01-29 23:24:53 +01:00
parent 45796ff6fa
commit fc9e921671
5 changed files with 145 additions and 0 deletions

23
aprsc.dockerfile Normal file
View File

@ -0,0 +1,23 @@
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y \
gnupg \
&& rm -rf /var/lib/apt/lists/*
RUN printf "deb http://aprsc-dist.he.fi/aprsc/apt focal main" >> /etc/apt/sources.list
RUN gpg --keyserver keyserver.ubuntu.com --recv C51AA22389B5B74C3896EF3CA72A581E657A2B8D
RUN gpg --export C51AA22389B5B74C3896EF3CA72A581E657A2B8D | apt-key add -
RUN apt-get update && apt-get install -y \
aprsc \
&& rm -rf /var/lib/apt/lists/*
RUN rm /opt/aprsc/etc/aprsc.conf
VOLUME /opt/aprsc/etc/aprsc.conf
EXPOSE 10152
EXPOSE 14580
EXPOSE 10155
EXPOSE 14501
CMD /opt/aprsc/sbin/aprsc -u aprsc -t /opt/aprsc -c /etc/aprsc.conf

2
db.dockerfile Normal file
View File

@ -0,0 +1,2 @@
FROM postgres
COPY misc/database/tables/* /docker-entrypoint-initdb.d/

75
docker-compose.yml Normal file
View File

@ -0,0 +1,75 @@
version: "3.9"
services:
aprsc:
build:
context: .
dockerfile: aprsc.dockerfile
restart: always
ports:
- "10152:10152"
- "14580:14580"
- "10155:10155"
- "14501:14501"
volumes:
- $PWD/config/aprsc.conf:/opt/aprsc/etc/aprsc.conf
collector:
build:
context: .
dockerfile: trackdirect-python2.dockerfile
restart: always
volumes:
- $PWD/config/trackdirect.ini:/root/trackdirect/config/trackdirect.ini
command: /root/trackdirect/server/scripts/collector.sh trackdirect.ini 0
depends_on:
- "db"
- "aprsc"
websocket:
build:
context: .
dockerfile: trackdirect-python2.dockerfile
restart: always
volumes:
- $PWD/config/trackdirect.ini:/root/trackdirect/config/trackdirect.ini
command: /root/trackdirect/server/scripts/wsserver.sh trackdirect.ini
ports:
- "9000:9000"
depends_on:
- "db"
- "aprsc"
heatmaps:
build:
context: .
dockerfile: trackdirect-python2.dockerfile
restart: always
volumes:
- $PWD/config/trackdirect.ini:/root/trackdirect/config/trackdirect.ini
- $PWD/heatmaps:/root/trackdirect/htdocs/public/heatmaps
command: /root/trackdirect/server/scripts/heatmapcreator.sh trackdirect.ini /root/trackdirect/htdocs/public/heatmaps
depends_on:
- "db"
web:
build:
context: .
dockerfile: trackdirect-apache.dockerfile
restart: always
volumes:
- $PWD/config/trackdirect.ini:/root/trackdirect/config/trackdirect.ini
- $PWD/heatmaps:/root/trackdirect/htdocs/public/heatmaps
ports:
- "80:80"
depends_on:
- "db"
db:
build:
context: .
dockerfile: db.dockerfile
restart: always
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: foobar
POSTGRES_DB: trackdirect

View File

@ -0,0 +1,24 @@
FROM php:7.2-apache
RUN apt-get update && apt-get install -y \
git \
libpq-dev \
postgresql-client-common \
postgresql-client \
libevent-dev \
libmagickwand-dev \
imagemagick \
inkscape \
&& rm -rf /var/lib/apt/lists/*
RUN pecl install imagick && docker-php-ext-enable imagick && docker-php-ext-install pdo pdo_pgsql
COPY . /root/trackdirect
COPY config/000-default.conf /etc/apache2/sites-enabled/
RUN a2enmod rewrite
RUN chmod a+rx / && chmod a+rx -R /root
RUN chmod 777 /root/trackdirect/htdocs/public/symbols
VOLUME /root/trackdirect/config/trackdirect.ini
VOLUME /root/trackdirect/htdocs/public/heatmaps

View File

@ -0,0 +1,21 @@
FROM ubuntu:20.04
RUN apt-get update && apt-get install -y \
python2 \
python2-dev \
git \
curl \
wget \
gcc \
&& rm -rf /var/lib/apt/lists/*
RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py && python2 get-pip.py
RUN pip2 install psycopg2-binary autobahn[twisted] twisted pympler image_slicer jsmin psutil
RUN git clone https://github.com/rossengeorgiev/aprs-python && cd aprs-python && pip2 install .
RUN wget http://jjguy.com/heatmap/heatmap-2.2.1.tar.gz && tar xzf heatmap-2.2.1.tar.gz && cd heatmap-2.2.1 && python2 setup.py install
COPY . /root/trackdirect
VOLUME /root/trackdirect/config/trackdirect.ini
VOLUME /root/trackdirect/htdocs/public/heatmaps