Update Dockerfile
Browse files- Dockerfile +10 -11
Dockerfile
CHANGED
|
@@ -1,25 +1,24 @@
|
|
| 1 |
-
# Use Alpine as the base
|
| 2 |
FROM alpine:latest
|
| 3 |
|
| 4 |
-
# Install
|
| 5 |
RUN apk add --no-cache curl && \
|
| 6 |
curl -L https://ziglang.org/download/0.14.0/zig-linux-x86_64-0.14.0.tar.xz | tar -Jxf - && \
|
| 7 |
-
mv zig-linux-x86_64-0.
|
| 8 |
ln -s /zig/zig /usr/local/bin/zig && \
|
| 9 |
apk del curl
|
| 10 |
|
| 11 |
# Set working directory
|
| 12 |
WORKDIR /app
|
| 13 |
|
| 14 |
-
# Copy
|
| 15 |
-
COPY
|
| 16 |
-
COPY src/ src/
|
| 17 |
|
| 18 |
# Build the Zig application
|
| 19 |
-
RUN zig build -
|
| 20 |
|
| 21 |
-
# Expose port
|
| 22 |
-
EXPOSE
|
| 23 |
|
| 24 |
-
# Run the application, binding to 0.0.0.0:
|
| 25 |
-
CMD ["
|
|
|
|
| 1 |
+
# Use the official Alpine image as the base for a smaller footprint
|
| 2 |
FROM alpine:latest
|
| 3 |
|
| 4 |
+
# Install curl to download Zig, then install Zig and clean up
|
| 5 |
RUN apk add --no-cache curl && \
|
| 6 |
curl -L https://ziglang.org/download/0.14.0/zig-linux-x86_64-0.14.0.tar.xz | tar -Jxf - && \
|
| 7 |
+
mv zig-linux-x86_64-0.14.0 /zig && \
|
| 8 |
ln -s /zig/zig /usr/local/bin/zig && \
|
| 9 |
apk del curl
|
| 10 |
|
| 11 |
# Set working directory
|
| 12 |
WORKDIR /app
|
| 13 |
|
| 14 |
+
# Copy the Zig source files
|
| 15 |
+
COPY . .
|
|
|
|
| 16 |
|
| 17 |
# Build the Zig application
|
| 18 |
+
RUN zig build -Drelease-small=true
|
| 19 |
|
| 20 |
+
# Expose port 3000
|
| 21 |
+
EXPOSE 3000
|
| 22 |
|
| 23 |
+
# Run the application, binding to 0.0.0.0:3000
|
| 24 |
+
CMD ["zig", "build", "run", "--", "-host", "0.0.0.0", "-port", "3000"]
|