Skip to content

Commit f9a24ef

Browse files
committed
Run http-server in prestart script
1 parent 5aa4c52 commit f9a24ef

File tree

5 files changed

+440
-18
lines changed

5 files changed

+440
-18
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
public
21
node_modules

docker-compose.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
version: "3.3"
22

33
services:
4-
http-server:
5-
container_name: http-server
6-
image: node:${NODE_VERSION}-buster
7-
restart: on-failure
8-
command: npx http-server /var/www -p 5000 -s
9-
volumes:
10-
- ./public:/var/www
11-
124
http-proxy:
135
build:
146
context: .
@@ -19,8 +11,8 @@ services:
1911
environment:
2012
- MODE
2113
- MEMORY_USAGE_INTERVAL
22-
- TARGET=http://http-server:5000
23-
- PORT=7000
14+
- HTTP_SERVER_PORT=5000
15+
- HTTP_PROXY_PORT=7000
2416
ports:
2517
- "7000:7000"
2618

@@ -30,5 +22,4 @@ services:
3022
restart: on-failure
3123
command: bash -c 'sleep 3; while :; do curl -s -I -X GET http://http-proxy:7000/sample.png > /dev/null; done'
3224
depends_on:
33-
- http-server
3425
- http-proxy

0 commit comments

Comments
 (0)