Skip to content

Commit d22ddff

Browse files
author
pluja
committed
first commit
0 parents  commit d22ddff

29 files changed

+3224
-0
lines changed

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
node_modules
2+
*.override.yml
3+
*.exe
4+
*.exe~
5+
*.dll
6+
*.so
7+
*.dylib
8+
*.test
9+
*.out
10+
go.work
11+
.env
12+
articles
13+
*.md
14+
style.css

Dockerfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Builder stage
2+
FROM devopsworks/golang-upx:1.20 as builder
3+
ENV DEBIAN_FRONTEND noninteractive
4+
WORKDIR /app
5+
COPY blogo .
6+
RUN go mod tidy
7+
8+
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o blogo . && \
9+
upx blogo
10+
11+
RUN chmod a+rx blogo
12+
13+
RUN mkdir -p /app/articles/
14+
15+
# Node stage
16+
FROM node:alpine AS node
17+
WORKDIR /app
18+
COPY . .
19+
RUN npm install && \
20+
npx tailwindcss -o ./style.css --minify
21+
22+
# Start from a complete image
23+
FROM alpine:latest as certs
24+
RUN apk --update add ca-certificates
25+
26+
# Final stage
27+
FROM scratch
28+
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
29+
30+
WORKDIR /app
31+
COPY --from=builder /app/blogo /app/blogo
32+
COPY --from=builder /app/articles /app/articles
33+
34+
# Copy HTML files
35+
COPY templates templates
36+
COPY static static
37+
38+
COPY --from=node /app/style.css ./html/static/css/style.css
39+
40+
EXPOSE 3000
41+
CMD ["/app/blogo", "-path", "/app"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 pluja
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)