Created
August 19, 2019 15:37
-
-
Save JulienBreux/cad7faa92d4d3f912199fccb87ad1ca2 to your computer and use it in GitHub Desktop.
Speed Nginx Docker (for tests)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nginx:1-alpine | |
COPY ./src/index.html /usr/share/nginx/html | |
COPY ./etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name localhost; | |
location / { | |
root /usr/share/nginx/html; | |
index index.html; | |
} | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root /usr/share/nginx/html; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Hello world!</title> | |
</head> | |
<body> | |
<h1>Hello world!</h1> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
vars: | |
CONTAINER_NAME: nginx-tmp | |
tasks: | |
build: | |
deps: ["kill"] | |
cmds: | |
- docker build -t nginx:tmp . | |
run: | |
deps: ["build"] | |
cmds: | |
- docker run --rm -d -p 8080:80 --name {{.CONTAINER_NAME}} nginx:tmp | |
kill: | |
cmds: | |
- docker rm --force {{.CONTAINER_NAME}} | |
enter: | |
cmds: | |
- docker exec -it $(docker ps -q --filter name={{.CONTAINER_NAME}}) sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment