Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
1c9c1d40df
|
|||
|
259ac9c652
|
|||
|
07bcf0073e
|
|||
|
edd3693fb6
|
|||
|
ea0a34258b
|
@@ -25,9 +25,10 @@ RUN mkdir -p /var/www && mkdir -p /var/www/data/speed
|
|||||||
WORKDIR /var/www
|
WORKDIR /var/www
|
||||||
|
|
||||||
# Copy web assets and scripts
|
# Copy web assets and scripts
|
||||||
COPY index.html /var/www/index.html
|
COPY src/index.html /var/www/index.html
|
||||||
COPY run_speed_test.sh /usr/local/bin/run_speed_test.sh
|
COPY src/favicon.ico /var/www/favicon.ico
|
||||||
COPY start.sh /usr/local/bin/start.sh
|
COPY src/run_speed_test.sh /usr/local/bin/run_speed_test.sh
|
||||||
|
COPY src/start.sh /usr/local/bin/start.sh
|
||||||
|
|
||||||
# Ensure scripts are executable
|
# Ensure scripts are executable
|
||||||
RUN chmod +x /usr/local/bin/run_speed_test.sh /usr/local/bin/start.sh
|
RUN chmod +x /usr/local/bin/run_speed_test.sh /usr/local/bin/start.sh
|
||||||
|
|||||||
@@ -47,7 +47,9 @@ docker run -d --name speed-data -e PORT=8080 -p 8080:8080 --restart unless-stopp
|
|||||||
Alternatively, run with a host bind mount (for direct access to files on the host):
|
Alternatively, run with a host bind mount (for direct access to files on the host):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker rm -f speed-data || true \
|
docker build -t speed-data-app .
|
||||||
|
|
||||||
|
docker rm -f $(docker ps -a -q --filter name=speed\-data --filter status=running) || true \
|
||||||
&& docker volume create speed-data-volume && \
|
&& docker volume create speed-data-volume && \
|
||||||
docker run -d --name speed-data -e CRON_MINUTE=18 -e PORT=8080 -p 8585:8080 --restart unless-stopped \
|
docker run -d --name speed-data -e CRON_MINUTE=18 -e PORT=8080 -p 8585:8080 --restart unless-stopped \
|
||||||
-v ~/docker-data/speed-data-app/data:/var/www/data/speed speed-data-app
|
-v ~/docker-data/speed-data-app/data:/var/www/data/speed speed-data-app
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
VERSION=0.2.0
|
VERSION=0.3.0
|
||||||
|
|
||||||
docker image build --no-cache -t asolkar/speed-data-docker:${VERSION} . && \
|
docker image build --no-cache -t asolkar/speed-data-docker:${VERSION} . && \
|
||||||
docker push asolkar/speed-data-docker:${VERSION}
|
docker push asolkar/speed-data-docker:${VERSION}
|
||||||
6
scripts/vscode
Executable file
6
scripts/vscode
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
/opt/vscode/VSCode-linux-x64/code \
|
||||||
|
--enable-features=UseOzonePlatform,WaylandWindowDecorations \
|
||||||
|
--ozone-platform-hint=auto \
|
||||||
|
--unity-launch %F . & disown %1
|
||||||
BIN
src/favicon.ico
Normal file
BIN
src/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.4 KiB |
@@ -29,14 +29,14 @@ service cron start || cron || true
|
|||||||
|
|
||||||
# Run the initial speed test once (in background) to populate files if possible
|
# Run the initial speed test once (in background) to populate files if possible
|
||||||
# We run it in background so server starts promptly. The cron will run hourly.
|
# We run it in background so server starts promptly. The cron will run hourly.
|
||||||
/usr/local/bin/run_speed_test.sh >> /var/log/cron.log 2>&1 || true &
|
/usr/local/bin/run_speed_test.sh >> /var/log/cron.log 2>&1 || true &
|
||||||
|
|
||||||
# Start busybox httpd serving /var/www on configured port in foreground
|
# Start busybox httpd serving /var/www on configured port in foreground
|
||||||
if command -v busybox >/dev/null 2>&1; then
|
if command -v busybox >/dev/null 2>&1; then
|
||||||
echo "starting busybox httpd on port ${PORT} serving /var/www"
|
echo "starting busybox httpd on port ${PORT} serving /var/www"
|
||||||
busybox httpd -f -p ${PORT} -h /var/www
|
busybox httpd -f -p ${PORT} -h /var/www
|
||||||
else
|
else
|
||||||
echo "warning: busybox httpd not found; container will keep running with cron only" >&2
|
echo "warning: busybox httpd not found; container will keep running with cron only" >&2
|
||||||
# keep the script running so container doesn't exit
|
# keep the script running so container doesn't exit
|
||||||
tail -f /var/log/cron.log
|
tail -f /var/log/cron.log
|
||||||
fi
|
fi
|
||||||
Reference in New Issue
Block a user