Skip to content

Commit 9a760f7

Browse files
committed
chore: cleanup Dockerfile, add note, ipv6 listen, remove HOST build arg
1 parent 208bf1b commit 9a760f7

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Dockerfile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
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
24
ARG RUST_VERSION=1.86.0
35
FROM rust:${RUST_VERSION}-bookworm AS builder
@@ -13,8 +15,7 @@ RUN USER=root cargo new --bin glim
1315
WORKDIR /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
5052
RUN addgroup --gid $GID $APP_USER \
@@ -67,13 +69,8 @@ ARG PORT=8000
6769
ENV PORT=${PORT}
6870
EXPOSE ${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
7673
HEALTHCHECK --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

Comments
 (0)