mirror of
https://github.com/skidoodle/pastebin
synced 2026-04-28 03:07:40 +02:00
fix docker
This commit is contained in:
+6
-13
@@ -1,21 +1,14 @@
|
|||||||
FROM golang:1.25.1-alpine AS builder
|
FROM golang:1.25.1-alpine AS builder
|
||||||
ENV CGO_ENABLED=0
|
|
||||||
ENV GOOS=linux
|
|
||||||
ENV GOARCH=amd64
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN go generate ./...
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o pastebin .
|
||||||
RUN go build -ldflags="-w -s" -o /pastebin .
|
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM scratch
|
||||||
RUN apk --no-cache add ca-certificates
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
COPY --from=builder /app/pastebin /pastebin
|
||||||
RUN mkdir /data && chown appuser:appgroup /data
|
COPY --from=builder /app/view /view
|
||||||
USER appuser
|
|
||||||
COPY --from=builder /pastebin /pastebin
|
|
||||||
COPY --from=builder /app/view/style.css /view/style.css
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
VOLUME /data
|
VOLUME /data
|
||||||
ENTRYPOINT ["/pastebin", "-db-path=/data/pastebin.db"]
|
ENTRYPOINT ["/pastebin", "-addr", ":3000", "-db-path", "/data/pastebin.db"]
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
FROM scratch
|
||||||
|
COPY pastebin /pastebin
|
||||||
|
COPY view /view
|
||||||
|
EXPOSE 3000
|
||||||
|
VOLUME /data
|
||||||
|
ENTRYPOINT ["/pastebin", "-addr", ":3000", "-db-path", "/data/pastebin.db"]
|
||||||
@@ -18,7 +18,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/app/database
|
- ./data:/data
|
||||||
```
|
```
|
||||||
|
|
||||||
### Manual Installation
|
### Manual Installation
|
||||||
|
|||||||
@@ -6,3 +6,5 @@ services:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
|
volumes:
|
||||||
|
- ./data:/data
|
||||||
|
|||||||
+3
-3
@@ -1,12 +1,12 @@
|
|||||||
services:
|
services:
|
||||||
pastebin:
|
pastebin:
|
||||||
container_name: pastebin
|
container_name: pastebin
|
||||||
image: ghcr.io/skidoodle/pastebin:main
|
image: ghcr.io/skidoodle/pastebin:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- 3000:3000
|
- "3000:3000"
|
||||||
volumes:
|
volumes:
|
||||||
- pastebin_data:/data
|
- pastebin_data:/data
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
pastebin_data:
|
pastebin_data:
|
||||||
|
|||||||
Reference in New Issue
Block a user