diff --git a/Dockerfile b/Dockerfile index 29c31a0..54208fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,19 +7,16 @@ COPY go.mod go.sum ./ RUN go mod download && \ go install github.com/swaggo/swag/cmd/swag@latest -# Copy source code and Makefile +# Copy source code COPY . . -# Install required tools and make scripts executable -RUN apk add --no-cache upx make bash && \ - chmod +x /app/lib/stylegen/gen.sh - -# Create necessary directories -RUN mkdir -p /app/public/css +# Install tools +RUN apk add --no-cache upx make # Generate assets and build with optimizations -SHELL ["/bin/bash", "-c"] -RUN cd /app && make generate && \ +RUN set -eux; \ + cd /app; \ + make generate; \ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \ -ldflags='-s -w -extldflags "-static"' \ -tags netgo,osusergo \ @@ -29,7 +26,6 @@ RUN cd /app && make generate && \ FROM scratch # Copy static files and assets -COPY --from=builder /app/public/css/styles.css /public/css/styles.css COPY --from=builder /app/docs /docs COPY --from=builder /go/bin/app /app diff --git a/Makefile b/Makefile index a6694fd..d6050c8 100644 --- a/Makefile +++ b/Makefile @@ -44,27 +44,28 @@ ensure-swag: go install github.com/swaggo/swag/cmd/swag@latest; \ } -reset: +reset: docker-clean @echo "$(CLEAN) Performing complete project reset..." @rm -f $(BINARY_NAME) - @rm -rf public/css/styles.css @rm -rf docs/docs.go docs/swagger.json docs/swagger.yaml @go clean -cache -testcache -modcache - @rm -rf $(BASE_PATH)/tw # Remove the 'tw' directory @echo "$(CHECK) Project reset complete" clean: @echo "$(CLEAN) Cleaning build artifacts..." @rm -f $(BINARY_NAME) - @rm -f public/css/styles.css @echo "$(CHECK) Cleanup complete" +docker-clean: + @echo "$(CLEAN) Cleaning Docker artifacts..." + @docker-compose down --rmi all --volumes + @echo "$(CHECK) Docker cleanup complete" + swaggergen: ensure-swag @echo "$(DOCS) Generating Swagger documentation..." @swag init @echo "$(CHECK) Swagger docs generated" -# Combined generation target generate: swaggergen build: generate diff --git a/content/favourite_tools_list.md b/content/favourite_tools_list.md index a6d6444..3bd9a28 100644 --- a/content/favourite_tools_list.md +++ b/content/favourite_tools_list.md @@ -15,11 +15,4 @@ I change what I use _constantly_ in order to find something that feels just righ 7. Dataflare - A simple but powerful cross-platform database client. Supports most common databases, including LibSQL which is rare! 8. Bruno - A simple and powerful API client, similar to Postman. An critical tool to debug API endpoints. -I hope you found this helpful! This will be periodically updated to avoid outdated recommendations. - -```javascript -let x = 2; -console.log(x); -``` -## H2 -### H3 \ No newline at end of file +I hope you found this helpful! This will be periodically updated to avoid outdated recommendations. \ No newline at end of file diff --git a/main.go b/main.go index 69174ad..20cf660 100755 --- a/main.go +++ b/main.go @@ -20,6 +20,9 @@ import ( //go:embed public/* var PublicFS embed.FS +//go:embed docs/* +var DocsFS embed.FS + // @title Atri.dad API // @version 1.0 // @description This is the API for atri.dad