mirror of
https://github.com/skidoodle/iphistory.git
synced 2025-02-15 08:29:16 +01:00
fix(docker): ensure data persistence across container updates
- Update Dockerfile to set BUILDER to /build - Update Dockerfile to set WORKDIR to /app - Update docker-compose.yml to use a named volume for iphistory service - Mount iphistory_data volume to /app directory in the container - Ensure data is preserved when pulling the latest image and recreating the container
This commit is contained in:
parent
909d5a14a3
commit
3148a47258
3 changed files with 7 additions and 7 deletions
|
@ -1,12 +1,12 @@
|
||||||
FROM golang:alpine as builder
|
FROM golang:alpine as builder
|
||||||
WORKDIR /app
|
WORKDIR /build
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN go build -o iphistory .
|
RUN go build -o iphistory .
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
RUN apk --no-cache add ca-certificates
|
RUN apk --no-cache add ca-certificates
|
||||||
WORKDIR /root/
|
WORKDIR /app/
|
||||||
COPY --from=builder /app/iphistory .
|
COPY --from=builder /build/iphistory .
|
||||||
COPY --from=builder /app/web ./web
|
COPY --from=builder /build/web ./web
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
CMD ["./iphistory"]
|
CMD ["./iphistory"]
|
||||||
|
|
|
@ -8,8 +8,8 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
volumes:
|
volumes:
|
||||||
- data:/app
|
- iphistory_data:/app
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
data:
|
iphistory_data:
|
||||||
driver: local
|
external: false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue