mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-05 16:56:22 +00:00
⚡️ feat: add post fetching by ID and improve blog home page
- Implemented `getPostById` API function to fetch a post by its ID. - Refactored the main page to use a new `BlogHome` component for better organization. - Added loading state and sorting functionality for posts on the blog home page. - Integrated label fetching and display on the blog home page. - Enhanced the blog card component with improved layout and statistics display. - Updated the navbar to use dynamic configuration values. - Added Docker support with a comprehensive build and push workflow. - Created a custom hook `useStoredState` for managing local storage state. - Added a new page for displaying individual posts with metadata generation. - Removed unused components and files to streamline the codebase.
This commit is contained in:
31
Dockerfile
31
Dockerfile
@ -0,0 +1,31 @@
|
||||
# build
|
||||
FROM golang:1.24.2-alpine3.21 AS builder
|
||||
|
||||
ENV TZ=Asia/Chongqing
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk --no-cache add build-base git tzdata
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN go build -o server ./cmd/server
|
||||
|
||||
# production
|
||||
FROM alpine:latest AS prod
|
||||
|
||||
ENV TZ=Asia/Chongqing
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/server /app/server
|
||||
|
||||
EXPOSE 8888
|
||||
|
||||
RUN chmod +x ./server
|
||||
|
||||
ENTRYPOINT ["./server"]
|
Reference in New Issue
Block a user