Add dockerfile
This commit is contained in:
parent
dfc3415972
commit
2c535dba83
2 changed files with 44 additions and 0 deletions
27
Dockerfile
Normal file
27
Dockerfile
Normal file
|
@ -0,0 +1,27 @@
|
|||
FROM golang as builder
|
||||
|
||||
WORKDIR /trantor/
|
||||
COPY main.go go.* /trantor/
|
||||
COPY lib/ /trantor/lib/
|
||||
|
||||
RUN CGO_ENABLED=0 go build -ldflags '-extldflags "-static"' .
|
||||
|
||||
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 /trantor/trantor /trantor
|
||||
|
||||
COPY robots.txt description.json opensearch.xml key.asc /assets/
|
||||
COPY img /assets/img/
|
||||
COPY css /assets/css/
|
||||
COPY js /assets/js/
|
||||
COPY templates /assets/templates/
|
||||
COPY logger.xml /
|
||||
|
||||
ENV TRANTOR_ASSETS=/assets
|
||||
ENV TRANTOR_STORE=/store
|
||||
VOLUME /store
|
||||
WORKDIR /
|
||||
|
||||
ENTRYPOINT ["/trantor"]
|
17
docker-compose.yml
Normal file
17
docker-compose.yml
Normal file
|
@ -0,0 +1,17 @@
|
|||
trantor:
|
||||
container_name: trantor
|
||||
hostname: trantor
|
||||
image: trantor
|
||||
restart: always
|
||||
ports:
|
||||
- "0.0.0.0:8080:8080" # web
|
||||
- "0.0.0.0:9123:9123" # prometheus
|
||||
volumes:
|
||||
- /opt/store:/store
|
||||
# - /opt/logger.xml:/logger.xml
|
||||
environment:
|
||||
- SESSION_KEY=
|
||||
- TRANTOR_DB_ADDR=localhost:5432
|
||||
- TRANTOR_DB_NAME=trantor
|
||||
- TRANTOR_DB_USER=trantor
|
||||
- TRANTOR_DB_PASSWORD=
|
Reference in a new issue