Skip to content

Commit

Permalink
Initial reproduction of bug
Browse files Browse the repository at this point in the history
  • Loading branch information
agjohnson committed Oct 29, 2024
0 parents commit 7faac91
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 0 deletions.
37 changes: 37 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
networks:
internal:

services:
wrangler:
image: 2988/wrangler
build: ./wrangler
depends_on:
fileserver:
condition: service_healthy
networks:
internal:
healthcheck:
test: netstat -an | grep 8787 > /dev/null; if [ 0 != $? ]; then exit 1; fi;
start_period: 60s
start_interval: 5s

fileserver:
image: 2988/fileserver
build: ./fileserver
networks:
internal:
healthcheck:
test: netstat -an | grep 9000 > /dev/null; if [ 0 != $? ]; then exit 1; fi;
start_period: 60s
start_interval: 5s

tests:
image: 2988/tests
build: ./tests
depends_on:
fileserver:
condition: service_healthy
wrangler:
condition: service_healthy
networks:
internal:
7 changes: 7 additions & 0 deletions fileserver/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM alpine:3.18
RUN apk add --no-cache python3
RUN mkdir /usr/local/app/
COPY ./generate.sh /usr/local/app/
WORKDIR /usr/local/app/
RUN /bin/sh generate.sh > 10mb.html
ENTRYPOINT ["python", "-m", "http.server", "9000"]
3 changes: 3 additions & 0 deletions fileserver/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
content=$(dd if=/dev/random bs=1MB count=10 | base64 -w0)
echo "<html><head></head><body><img src='data:image/png;base64,$content' /></body></html>"
6 changes: 6 additions & 0 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM alpine:3.18
RUN apk add --no-cache curl
RUN mkdir /usr/local/app/
COPY ./tests.sh /usr/local/app/
WORKDIR /usr/local/app/
ENTRYPOINT ["/bin/sh", "tests.sh"]
3 changes: 3 additions & 0 deletions tests/tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#/bin/sh
curl -o - http://wrangler:8787 > /dev/null
curl -o - http://wrangler:8787 > /dev/null
8 changes: 8 additions & 0 deletions wrangler/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:18-slim
RUN apt update && apt install net-tools
RUN npm install -g [email protected]
RUN mkdir /usr/local/app/
COPY ./index.js /usr/local/app/
COPY ./wrangler.toml /usr/local/app/
WORKDIR /usr/local/app/
ENTRYPOINT ["wrangler", "dev", "--ip", "0.0.0.0"]
6 changes: 6 additions & 0 deletions wrangler/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
async fetch(request, env, ctx) {
const response = await fetch("http://fileserver:9000/10mb.html");
return response;
}
};
4 changes: 4 additions & 0 deletions wrangler/wrangler.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name = "2988"
main = "index.js"
compatibility_date = "2024-01-01"
compatibility_flags = ["nodejs_compat"]

0 comments on commit 7faac91

Please sign in to comment.