Docker compose attempt 1

trunk
HeNine 3 years ago
parent 2f4189bc31
commit 11954d1a31

@ -0,0 +1,13 @@
#!/bin/bash
VERSION=0.0.0
bash fetch_models.sh
docker build -f buscribe/Dockerfile -t buscribe:$VERSION .
docker build -f buscribe-api/Dockerfile -t buscribe-api:$VERSION .
docker build -f less/Dockerfile -t lessc
docker run --rm -v "$(pwd)"/buscribe-web:/buscribe-web lessc /buscribe-web/style.less > buscribe-web/style.css
docker build -f nginx/Dockerfile -t buscribe-web:$VERSION .

@ -15,4 +15,4 @@ RUN apk add postgresql-dev postgresql-libs
COPY buscribe-api /tmp/buscribe-api COPY buscribe-api /tmp/buscribe-api
RUN pip install /tmp/buscribe-api && rm -r /tmp/buscribe-api RUN pip install /tmp/buscribe-api && rm -r /tmp/buscribe-api
ENTRYPOINT ["python3", "-m", "buscribeapi"] ENTRYPOINT ["python3", "-m", "buscribeapi", "--base-dir", "/mnt"]

@ -0,0 +1,31 @@
version: 3
services:
buscribenginx:
image: buscribe-web:0.0.0
ports:
- "8020:80"
volumes:
- /srv/wubloader/segments:/usr/share/nginx/html/segments
networks:
- wubloader_default
restart: "on-failure"
buscribelrr:
image: buscribe:0.0.0
command: [ "loadingreadyrun",
"--start-time='2021-11-05T00:00",
"--end-time='2021-11-30T00:00" .
"--database=postgresql://vst:flnMSYPRf@mula.lan:6543/buscribe_lrr",
"--model=/usr/share/buscribe/vosk-model-en-us-0.22/" ]
volumes:
- /srv/wubloader/segments:/mnt
buscribeapilrr:
image: buscribe-api:0.0.0
command: [
"--database=postgresql://vst:flnMSYPRf@mula.lan:6543/buscribe_lrr"
"--bustime-start=2021-11-13T02:00:00"]
networks:
wubloader_default:
external: true

@ -0,0 +1,5 @@
FROM node:17-alpine
RUN npm install less -g
ENTRYPOINT ["lessc"]

@ -0,0 +1,4 @@
FROM nginx:latest
COPY buscribe-web /usr/share/nginx/html/buscribe
COPY nginx/nginx.conf /etc/nginx/nginx.conf

@ -0,0 +1,52 @@
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
gzip gzip_comp_level 9;
absolute_redirect off;
server {
listen 80;
server_name localhost;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location / { proxy_pass http://nginx; }
location /buscribelrr { proxy_pass http://buscribeapilrr; }
}
}
Loading…
Cancel
Save