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
15c94b8949
commit
f0d7f8fd8c
|
@ -19,6 +19,15 @@ services:
|
|||
volumes:
|
||||
- './janitor:/config:ro'
|
||||
- './volatile/files:/opt/user_uploads'
|
||||
resourced:
|
||||
build:
|
||||
context: resource
|
||||
dockerfile: Dockerfile.prod
|
||||
networks:
|
||||
bfile:
|
||||
pid: host # prefork
|
||||
volumes:
|
||||
- './resource:/opt/cont'
|
||||
caddy:
|
||||
image: caddy:alpine
|
||||
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