mirror of
https://github.com/selfhst/icons.git
synced 2026-04-30 13:26:18 -04:00
Update build files for v2.0.0
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,4 +1,5 @@
|
|||||||
.*
|
.*
|
||||||
staging/
|
staging/
|
||||||
!/.gitignore
|
!/.gitignore
|
||||||
!/.github
|
!/.github
|
||||||
|
!build/.dockerignore
|
||||||
13
build/.dockerignore
Executable file
13
build/.dockerignore
Executable file
@@ -0,0 +1,13 @@
|
|||||||
|
node_modules
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
README.md
|
||||||
|
.env
|
||||||
|
.nyc_output
|
||||||
|
coverage
|
||||||
|
.vscode
|
||||||
|
.DS_Store
|
||||||
|
*.log
|
||||||
@@ -1,26 +1,19 @@
|
|||||||
# Build stage
|
|
||||||
FROM golang:1.21-alpine AS builder
|
FROM golang:1.21-alpine AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy source code first
|
|
||||||
COPY go.mod main.go ./
|
COPY go.mod main.go ./
|
||||||
|
|
||||||
# Download dependencies and build
|
|
||||||
RUN go mod tidy && \
|
RUN go mod tidy && \
|
||||||
go mod download && \
|
go mod download && \
|
||||||
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o server .
|
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o server .
|
||||||
|
|
||||||
# Final stage - use scratch for minimal image
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
|
||||||
# Add ca-certificates for HTTPS requests
|
|
||||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
|
|
||||||
# Copy the binary
|
|
||||||
COPY --from=builder /app/server /server
|
COPY --from=builder /app/server /server
|
||||||
|
|
||||||
# Create non-root user
|
|
||||||
USER 65534:65534
|
USER 65534:65534
|
||||||
|
|
||||||
EXPOSE 4050
|
EXPOSE 4050
|
||||||
|
|||||||
Reference in New Issue
Block a user