Files
leonwww/dns/Dockerfile

55 lines
1.3 KiB
Docker
Raw Normal View History

2025-08-25 14:01:54 +03:00
FROM rustlang/rust:nightly-alpine AS builder
2025-08-25 13:51:40 +03:00
RUN apk add --no-cache \
musl-dev \
openssl-dev \
openssl-libs-static \
pkgconfig \
postgresql-dev
ENV OPENSSL_STATIC=1
ENV OPENSSL_DIR=/usr
ENV PKG_CONFIG_ALLOW_CROSS=1
WORKDIR /app
2025-08-25 13:59:30 +03:00
COPY protocol/library ../protocol/library
2025-08-25 14:00:59 +03:00
COPY dns/Cargo.toml ./
2025-08-25 13:57:08 +03:00
COPY dns/src ./src
COPY dns/migrations ./migrations
2025-08-25 13:51:40 +03:00
RUN cargo build --release
FROM alpine:3.19
RUN apk add --no-cache \
ca-certificates \
2025-08-25 14:51:08 +03:00
postgresql-client \
wget
2025-08-25 13:51:40 +03:00
RUN addgroup -g 1001 -S appgroup && \
adduser -u 1001 -S appuser -G appgroup
WORKDIR /app
COPY --from=builder /app/target/release/webx_dns /app/webx_dns
COPY --from=builder /app/migrations ./migrations
2025-09-05 16:22:27 +03:00
COPY dns/frontend ./frontend
2025-09-08 19:46:40 +03:00
COPY search-engine/frontend ./search-engine/frontend
2025-08-25 13:51:40 +03:00
2025-08-25 14:51:08 +03:00
RUN mkdir -p /app/config /app/data /home/matt/gurted/dns/certs && \
chown -R appuser:appgroup /app && \
chown -R appuser:appgroup /home/matt && \
ls -la /home/matt/gurted/dns/ && \
echo "Directory structure created successfully"
2025-08-25 13:51:40 +03:00
USER appuser
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/health || exit 1
# Default command
2025-08-25 14:51:08 +03:00
CMD ["sh", "-c", "ls -la /home/matt/gurted/dns/certs/ && ./webx_dns --config /app/config/config.toml start"]