docker-scripts/linux/ecosystem/torrust-tracker/Dockerfile

40 lines
1.1 KiB
Docker
Raw Normal View History

2022-08-16 16:42:00 +03:00
FROM epicmorg/debian:bullseye-develop as builder
RUN git clone https://github.com/torrust/torrust-tracker.git -b develop /opt/torrust-tracker && \
2022-08-16 16:42:00 +03:00
cd /opt/torrust-tracker && \
cargo build --release && \
ls -las && \
cd ./target/release/ && \
ls -las
FROM epicmorg/debian:bullseye
ARG TORRUST_PORT=1337
ARG TORRUST_ADMIN=1488
ENV TORRUST_DIR=/app
ENV TORRUST_DATA=${TORRUST_DIR}/data
2022-08-16 16:42:00 +03:00
RUN mkdir -p ${TORRUST_DIR} ${TORRUST_DATA}
2022-08-16 16:42:00 +03:00
RUN ln -sf ${TORRUST_DATA}/config.toml ${TORRUST_DIR}/config.toml
RUN ln -sf ${TORRUST_DATA}/data.db ${TORRUST_DIR}/data.db
2022-08-16 16:42:00 +03:00
COPY --from=builder /opt/torrust-tracker/target/release/torrust-tracker ${TORRUST_DIR}/torrust-tracker
RUN chmod 755 ${TORRUST_DIR}/torrust-tracker
2022-08-16 16:42:00 +03:00
EXPOSE ${TORRUST_PORT}
EXPOSE ${TORRUST_PORT}/udp
EXPOSE ${TORRUST_ADMIN}
2022-08-16 16:42:00 +03:00
WORKDIR ${TORRUST_DIR}
VOLUME ${TORRUST_DATA}
2022-08-16 16:42:00 +03:00
# Add image configuration and scripts
COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh
RUN chmod 755 /usr/bin/docker-entrypoint.sh
ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"]
CMD ["docker-entrypoint.sh"]