Skip to content
Snippets Groups Projects
Verified Commit 097b5818 authored by Dorian Koch's avatar Dorian Koch
Browse files

Add webserver

parent b571c624
No related branches found
No related tags found
No related merge requests found
......@@ -8,8 +8,9 @@ RUN apt-get update \
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY wait-for-it.sh .
RUN chmod +x wait-for-it.sh
COPY *.html .
COPY *.sh .
RUN chmod +x *.sh
COPY *.py .
CMD ["python", "main.py"]
services:
monitor:
build: .
init: true
......@@ -13,6 +12,28 @@ services:
- postgres
command: ["./wait-for-it.sh", "postgres:5432", "--", "python", "main.py"]
visualize:
build: .
init: true
restart: unless-stopped
environment:
- DB_HOST=postgres
- DB_NAME=response_times
- DB_USER=myuser
- DB_PASSWORD=mypassword
depends_on:
- postgres
- monitor
ports:
- 12923:12923
command:
[
"./wait-for-it.sh",
"postgres:5432",
"--",
"./run_visualize_webserver.sh",
]
postgres:
image: postgres:13
restart: unless-stopped
......
#!/usr/bin/env bash
python export.py > exported.csv
mkdir -p /var/www/html
mv exported.csv /var/www/html
cp visualize.html /var/www/html
cd /var/www/html
python3 -m http.server 12923
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment