# Use the official Alpine image as the base for a smaller footprint | |
FROM alpine:latest | |
# Install curl to download Zig, then install Zig and clean up | |
RUN apk add --no-cache curl && \ | |
curl -L https://ziglang.org/download/0.14.0/zig-linux-x86_64-0.14.0.tar.xz | tar -Jxf - && \ | |
mv zig-linux-x86_64-0.14.0 /zig && \ | |
ln -s /zig/zig /usr/local/bin/zig && \ | |
apk del curl | |
# Set working directory | |
WORKDIR /app | |
# Copy the Zig source files | |
COPY . . | |
# Build the Zig application | |
RUN zig build | |
# Expose port 3000 | |
EXPOSE 3000 | |
# Run the application, binding to 0.0.0.0:3000 | |
CMD ["./zig-out/bin/newmine"] |