Compare commits
7 Commits
c68207724c
...
master
Author | SHA1 | Date | |
---|---|---|---|
58df8350c0 | |||
e336d0955c | |||
d8ee53cf7a | |||
f88f97bd0c | |||
14fd9f55ce | |||
7731b9ae50 | |||
9512bd677d |
30
Dockerfile
Normal file
30
Dockerfile
Normal file
@ -0,0 +1,30 @@
|
||||
# Use the official Go 1.23 image as the build stage
|
||||
FROM golang:1.23 as build
|
||||
|
||||
# Set the working directory to /app
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the Go mod files
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
# Download the dependencies
|
||||
RUN go mod download
|
||||
|
||||
# Copy the application code
|
||||
COPY . .
|
||||
|
||||
# Build the application
|
||||
RUN go build -o main cmd/main.go
|
||||
|
||||
# Use the scratch image as the runtime stage
|
||||
FROM scratch
|
||||
|
||||
# Copy the built application from the build stage
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/main /app/
|
||||
|
||||
# Expose the port
|
||||
EXPOSE 1337
|
||||
|
||||
# Run the command to start the application
|
||||
CMD ["./main"]
|
@ -1,6 +1,6 @@
|
||||
[Boner site and guestbook](https://boner.be)
|
||||
|
||||
Implementation of boner.be website and guestbook with the meme stack of Go and HTMX
|
||||
Implementation of boner.be website and guestbook with the meme stack of Go and HTMX and also Tailwind
|
||||
|
||||
`(_)_)::::::::::::::D~~~~`
|
||||
|
||||
|
@ -59,8 +59,8 @@ func (d *Data) indexOf(id int) int {
|
||||
func newData() Data {
|
||||
return Data{
|
||||
Entries: []Entry{
|
||||
newEntry("John Smith", "Hello world"),
|
||||
newEntry("Jane Doe", "This is a great guestbook"),
|
||||
newEntry("Asshole", "Hey, this is SHIT!"),
|
||||
newEntry("Not Bd", "Fist my ginger pubes, faghole"),
|
||||
},
|
||||
}
|
||||
}
|
||||
@ -109,7 +109,7 @@ func main() {
|
||||
message := c.FormValue("message")
|
||||
|
||||
entry := newEntry(name, message)
|
||||
page.Data.Entries = append(page.Data.Entries, entry)
|
||||
page.Data.Entries = append([]Entry{entry}, page.Data.Entries...)
|
||||
|
||||
c.Render(200, "form", newFormData())
|
||||
return c.Render(200, "oob-entry", entry)
|
||||
|
@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<script src="https://unpkg.com/htmx.org/dist/htmx.min.js"></script>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<title>Hacker Guestbook</title>
|
||||
<title>Boanerbook</title>
|
||||
<script>
|
||||
tailwind.config = {
|
||||
theme: {
|
||||
|
Reference in New Issue
Block a user