first commit
This commit is contained in:
commit
5cb003f241
6
Dockerfile
Normal file
6
Dockerfile
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM golang:1.13
|
||||||
|
RUN go get -u github.com/johndoe/mywebserver/template/...
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
RUN go install .
|
||||||
|
CMD ["/app/myweb"]
|
BIN
assets/img/logo.png
Normal file
BIN
assets/img/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 216 KiB |
2
assets/js/script.js
Normal file
2
assets/js/script.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
console.log('Hello from script.js!');
|
||||||
|
alert('JavaScript is working!');
|
4
build_dockerImage.sh
Executable file
4
build_dockerImage.sh
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
docker build -t mywebserver:1.0 .
|
||||||
|
|
||||||
|
docker run -d -p 8000:8000 mywebserver:1.0
|
12
main.go
Normal file
12
main.go
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "net/http"
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
http.HandleFunc("/", hello)
|
||||||
|
http.ListenAndServe(":8000", nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
func hello(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.Write([]byte("Hello World!"))
|
||||||
|
}
|
2
templates/index.html
Normal file
2
templates/index.html
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<img src="/static/img/logo.png">
|
||||||
|
<script src="/static/js/script.js"></script>
|
Loading…
Reference in New Issue
Block a user