Reviewed-on: #1
This commit is contained in:
parent
e87932e375
commit
1e228ed338
27
.gitignore
vendored
Normal file
27
.gitignore
vendored
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# Created by https://www.toptal.com/developers/gitignore/api/go
|
||||||
|
# Edit at https://www.toptal.com/developers/gitignore?templates=go
|
||||||
|
|
||||||
|
### Go ###
|
||||||
|
# If you prefer the allow list template instead of the deny list, see community template:
|
||||||
|
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
|
||||||
|
#
|
||||||
|
# Binaries for programs and plugins
|
||||||
|
*.exe
|
||||||
|
*.exe~
|
||||||
|
*.dll
|
||||||
|
*.so
|
||||||
|
*.dylib
|
||||||
|
|
||||||
|
# Test binary, built with `go test -c`
|
||||||
|
*.test
|
||||||
|
|
||||||
|
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||||
|
*.out
|
||||||
|
|
||||||
|
# Dependency directories (remove the comment below to include it)
|
||||||
|
# vendor/
|
||||||
|
|
||||||
|
# Go workspace file
|
||||||
|
go.work
|
||||||
|
|
||||||
|
# End of https://www.toptal.com/developers/gitignore/api/go
|
14
Dockerfile
14
Dockerfile
@ -1,4 +1,10 @@
|
|||||||
FROM docker.io/nginx:latest
|
FROM docker.io/golang:1.23 as build
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
COPY src/ .
|
||||||
COPY html/ /usr/share/nginx/html/
|
RUN printf 'module yw5n\ngo 1.23' > go.mod && CGO_ENABLED=0 go build -o /app
|
||||||
COPY static/ /usr/share/nginx/static/
|
|
||||||
|
FROM scratch
|
||||||
|
COPY --from=build /app /app
|
||||||
|
COPY static/ /static/
|
||||||
|
COPY html/ /html/
|
||||||
|
EXPOSE 3000
|
||||||
|
CMD ["/app"]
|
||||||
|
@ -3,4 +3,4 @@ services:
|
|||||||
app:
|
app:
|
||||||
build: .
|
build: .
|
||||||
ports:
|
ports:
|
||||||
- "8000:80"
|
- "3000:3000"
|
||||||
|
@ -9,14 +9,14 @@
|
|||||||
<div id="header">
|
<div id="header">
|
||||||
<a id="headerLink" href="/">Ange DUHAYON</a>
|
<a id="headerLink" href="/">Ange DUHAYON</a>
|
||||||
<span id="headerSubtitle">Engineer DevOps</span>
|
<span id="headerSubtitle">Engineer DevOps</span>
|
||||||
<span class="right" style="font-size: .4em;">Website heavily inspired from <a href="https://suckless.org" target="_blank" rel="noreferrer noopener">suckless.org</a></span>
|
<span class="right" style="font-size: .4em;">Website heavily inspired from <a href="//suckless.org/" target="_blank" rel="noreferrer noopener">suckless.org</a></span>
|
||||||
</div>
|
</div>
|
||||||
<div id="menu">
|
<div id="menu">
|
||||||
<a href="/">contact</a>
|
<a href="/">contact</a>
|
||||||
<a href="/resume.html">resume</a>
|
<a href="/resume">resume</a>
|
||||||
<a href="/about.html"><b>about me</b></a>
|
<a href="/about"><b>about me</b></a>
|
||||||
<span class="right">
|
<span class="right">
|
||||||
<a href="//git.gmoker.com/yw5n/">source</a>
|
<a href="//git.gmoker.com/yw5n/" target="_blank" rel="noreferrer noopener">source</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div id="content">
|
<div id="content">
|
||||||
|
@ -9,16 +9,16 @@
|
|||||||
<div id="header">
|
<div id="header">
|
||||||
<a id="headerLink" href="/">Ange DUHAYON</a>
|
<a id="headerLink" href="/">Ange DUHAYON</a>
|
||||||
<span id="headerSubtitle">Engineer DevOps</span>
|
<span id="headerSubtitle">Engineer DevOps</span>
|
||||||
<span class="right" style="font-size: .4em;">Website heavily inspired from <a href="https://suckless.org" target="_blank" rel="noreferrer noopener">suckless.org</a></span>
|
<span class="right" style="font-size: .4em;">Website heavily inspired from <a href="//suckless.org/" target="_blank" rel="noreferrer noopener">suckless.org</a></span>
|
||||||
</div>
|
</div>
|
||||||
<div id="menu">
|
<div id="menu">
|
||||||
<a href="/"><b>contact</b></a>
|
<a href="/"><b>contact</b></a>
|
||||||
<a href="/resume.html">resume</a>
|
<a href="/resume">resume</a>
|
||||||
<!--
|
<!--
|
||||||
<a href="/about.html">about me</a>
|
<a href="/about">about me</a>
|
||||||
-->
|
-->
|
||||||
<span class="right">
|
<span class="right">
|
||||||
<a href="//git.gmoker.com/yw5n/">source</a>
|
<a href="//git.gmoker.com/yw5n/" target="_blank" rel="noreferrer noopener">source</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div id="content">
|
<div id="content">
|
||||||
@ -36,11 +36,11 @@
|
|||||||
<div id="main">
|
<div id="main">
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr id="matrix"><td>Matrix (Element)</td><td><a href="https://app.element.io/#/user/@ange:gmoker.com">@ange:gmoker.com</a></td></tr>
|
<tr id="matrix"><td>Matrix (Element)</td><td><a href="//app.element.io/#/user/@ange:gmoker.com">@ange:gmoker.com</a></td></tr>
|
||||||
<tr id="discord"><td>Discord</td><td>@elrilio</td></tr>
|
<tr id="discord"><td>Discord</td><td>@elrilio</td></tr>
|
||||||
<tr id="phone"><td>Phone (France)</td><td><a href="tel:+33582951623">+33 5 82 95 16 23</a></td></tr>
|
<tr id="phone"><td>Phone (France)</td><td><a href="tel:+33582951623">+33 5 82 95 16 23</a></td></tr>
|
||||||
<tr id="email"><td>Email</td><td><a href="mailto:ange@yw5n.com">ange@yw5n.com</a></td></tr>
|
<tr id="email"><td>Email</td><td><a href="mailto:ange@yw5n.com">ange@yw5n.com</a></td></tr>
|
||||||
<tr id="wa"><td>WhatsApp</td><td><a href="https://wa.me/6285333559453">+62 853-3355-9453</a></td></tr>
|
<tr id="wa"><td>WhatsApp</td><td><a href="//wa.me/6285333559453">+62 853-3355-9453</a></td></tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -9,16 +9,16 @@
|
|||||||
<div id="header">
|
<div id="header">
|
||||||
<a id="headerLink" href="/">Ange DUHAYON</a>
|
<a id="headerLink" href="/">Ange DUHAYON</a>
|
||||||
<span id="headerSubtitle">Engineer DevOps</span>
|
<span id="headerSubtitle">Engineer DevOps</span>
|
||||||
<span class="right" style="font-size: .4em;">Website heavily inspired from <a href="https://suckless.org" target="_blank" rel="noreferrer noopener">suckless.org</a></span>
|
<span class="right" style="font-size: .4em;">Website heavily inspired from <a href="//suckless.org/" target="_blank" rel="noreferrer noopener">suckless.org</a></span>
|
||||||
</div>
|
</div>
|
||||||
<div id="menu">
|
<div id="menu">
|
||||||
<a href="/">contact</a>
|
<a href="/">contact</a>
|
||||||
<a href="/resume.html"><b>resume</b></a>
|
<a href="/resume"><b>resume</b></a>
|
||||||
<!--
|
<!--
|
||||||
<a href="/about.html">about me</a>
|
<a href="/about">about me</a>
|
||||||
-->
|
-->
|
||||||
<span class="right">
|
<span class="right">
|
||||||
<a href="//git.gmoker.com/yw5n/">source</a>
|
<a href="//git.gmoker.com/yw5n/" target="_blank" rel="noreferrer noopener">source</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<hr class="hidden"/>
|
<hr class="hidden"/>
|
||||||
|
@ -61,4 +61,4 @@ spec:
|
|||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: 80
|
containerPort: 3000
|
||||||
|
14
nginx.conf
14
nginx.conf
@ -1,14 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
|
||||||
listen [::]:80;
|
|
||||||
server_name localhost;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
index index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /static/ {
|
|
||||||
root /usr/share/nginx/;
|
|
||||||
}
|
|
||||||
}
|
|
33
src/main.go
Normal file
33
src/main.go
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"log"
|
||||||
|
"net/http"
|
||||||
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
func html(w http.ResponseWriter, r *http.Request) {
|
||||||
|
if r.URL.Path == "/style.css" {
|
||||||
|
http.ServeFile(w, r, "/html/style.css")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if strings.HasPrefix(r.URL.Path, "/static/") {
|
||||||
|
http.ServeFile(w, r, r.URL.Path)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if r.URL.Path == "/" {
|
||||||
|
http.ServeFile(w, r, "/html/index.html")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
http.ServeFile(w, r, filepath.Join("/html", r.URL.Path + ".html"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
http.HandleFunc("/", html)
|
||||||
|
|
||||||
|
err := http.ListenAndServe(":3000", nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
}
|
19
src/vars/vars.go
Normal file
19
src/vars/vars.go
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package vars
|
||||||
|
|
||||||
|
import (
|
||||||
|
"path/filepath"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
templates string
|
||||||
|
static string
|
||||||
|
html string
|
||||||
|
css string
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
templates = "templates"
|
||||||
|
static = "static"
|
||||||
|
html = filepath.Join(static, "html")
|
||||||
|
css = filepath.Join(static, "css")
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user