1+ # Note: This Dockerfile is used for this project's Railway deployment and image testing. It may not be suitable for your use case.
2+
13# Build Stage
24ARG RUST_VERSION=1.86.0
35FROM rust:${RUST_VERSION}-bookworm AS builder
@@ -13,8 +15,7 @@ RUN USER=root cargo new --bin glim
1315WORKDIR /usr/src/glim
1416
1517# Copy dependency files for better layer caching
16- COPY ./Cargo.toml ./Cargo.lock* ./build.rs ./
17- COPY ./card.svg ./
18+ COPY ./Cargo.toml ./Cargo.lock* ./build.rs ./card.svg ./
1819
1920# Build empty app with downloaded dependencies to produce a stable image layer for next build
2021# Note: Docker image builds server-only version (no CLI dependencies)
@@ -44,7 +45,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
4445 wget \
4546 && rm -rf /var/lib/apt/lists/*
4647
47- ENV TZ=Etc/UTC
48+ ARG TZ=Etc/UTC
49+ ENV TZ=${TZ}
4850
4951# Create user with specific UID/GID
5052RUN addgroup --gid $GID $APP_USER \
@@ -67,13 +69,8 @@ ARG PORT=8000
6769ENV PORT=${PORT}
6870EXPOSE ${PORT}
6971
70- # Build-time arg for HOST, default to 0.0.0.0 (ipv4 all interfaces)
71- ARG HOST=0.0.0.0
72- # Runtime environment var for HOST, default to build-time arg
73- ENV HOST=${HOST}
74-
7572# Add health check
7673HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
7774 CMD wget --no-verbose --tries=1 --spider http://localhost:${PORT}/health || exit 1
7875
79- CMD ["sh" , "-c" , "exec ./glim ${HOST} :${PORT}" ]
76+ CMD ["sh" , "-c" , "exec ./glim 0.0.0.0:${PORT},[::] :${PORT}" ]
0 commit comments