Add dockerfile

master
2577 2 years ago
parent e409a5ca17
commit 2541383002
  1. 20
      Dockerfile
  2. 14
      docker-compose.yml

@ -0,0 +1,20 @@
FROM debian as builder
RUN apt-get update && \
apt-get install -y git golang
WORKDIR /src/
COPY *.go go.mod go.sum /src/
RUN CGO_ENABLED=0 go build -ldflags '-extldflags "-static"' -o feed
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /src/feed /feed
COPY static /
COPY index.html /
RUN mkdir /data
VOLUME /data
ENTRYPOINT ["/feed"]

@ -0,0 +1,14 @@
feed:
container_name: feed
hostname: feed
image: feed
restart: always
user: 100:65534
ports:
- "127.0.0.1:2577:2577"
volumes:
- /opt/feed:/data
environment:
- FEED_DB_PATH=/data/feed.db
- FEED_CUSTOMER_KEY=<random-key>
- FEED_ACCESS_TOKEN=<random-token>
Loading…
Cancel
Save