Skip to content

Commit

Permalink
switch image to scratch
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Dec 7, 2023
1 parent 2cb7f68 commit 9e41f50
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
15 changes: 10 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@ RUN \
cd app && go build -o /build/tg-spam -ldflags "-X main.revision=${version} -s -w"


FROM umputun/baseimage:app-latest
FROM ghcr.io/umputun/baseimage/app:v1.11.0 as base

FROM scratch

COPY --from=build /build/tg-spam /srv/tg-spam
RUN chown -R app:app /srv
COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=base /etc/passwd /etc/passwd
COPY --from=base /etc/group /etc/group

USER app
COPY data/* /data/

VOLUME /data
WORKDIR /srv

CMD ["/srv/tg-spam"]
ENTRYPOINT ["/srv/tg-spam"]
12 changes: 4 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
version: '2'
services:
telegram-bot:
build: .
tg-spam:
image: umputun/tg-spam:master # use :latest tag for production
hostname: tg-spam
restart: always
container_name: tg-spam

logging:
driver: json-file
options:
max-size: "10m"
max-file: "5"

environment:
- TELEGRAM_TOKEN
- TELEGRAM_GROUP
- DRY=true
- DEBUG=true
volumes:
- ./logs:/srv/logs
- ./html:/srv/html
- ./var:/data # map user-provided samples to /data

command: /srv/tg-spam --super=umputun --super=bobuk --super=grayru --super=ksenks
command: /srv/tg-spam --super=name1 --super=name2

0 comments on commit 9e41f50

Please sign in to comment.