deploy resourced to production dockerfile
Note: I did not test the compose file on my machine before submitting the commit. May or may not work.
This commit is contained in:
parent
27e386fb35
commit
d299ea6e76
|
@ -19,6 +19,15 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- './janitor:/config:ro'
|
- './janitor:/config:ro'
|
||||||
- './volatile/files:/opt/user_uploads'
|
- './volatile/files:/opt/user_uploads'
|
||||||
|
resourced:
|
||||||
|
build:
|
||||||
|
context: resource
|
||||||
|
dockerfile: Dockerfile.prod
|
||||||
|
networks:
|
||||||
|
bfile:
|
||||||
|
pid: host # prefork
|
||||||
|
volumes:
|
||||||
|
- './resource:/opt/cont'
|
||||||
caddy:
|
caddy:
|
||||||
image: caddy:alpine
|
image: caddy:alpine
|
||||||
volumes:
|
volumes:
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
FROM golang:alpine3.17 as builder
|
||||||
|
|
||||||
|
WORKDIR /opt/build
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN apk add --no-cache git musl-dev upx binutils
|
||||||
|
|
||||||
|
RUN go build . && \
|
||||||
|
strip resourced && \
|
||||||
|
upx resourced
|
||||||
|
|
||||||
|
FROM alpine:3.17
|
||||||
|
|
||||||
|
WORKDIR /opt/code
|
||||||
|
COPY --from=builder /opt/build/resourced /usr/bin/resourced
|
||||||
|
|
||||||
|
# Note
|
||||||
|
# -----
|
||||||
|
# Since this is running with prefork, don't
|
||||||
|
# forget to set --pid=host when running this app
|
||||||
|
|
||||||
|
CMD [ "sh", "-c", "/usr/bin/resourced" ]
|
Loading…
Reference in New Issue