Skip to content

Commit c3d76b7

Browse files
Update Dockerfile
1 parent 7350155 commit c3d76b7

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

Dockerfile

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,44 @@
1+
# Stage 1: Build Nitter from the nimlang image
12
FROM nimlang/nim:2.0.0-alpine-regular as nim
2-
LABEL maintainer="setenforce@protonmail.com"
33

4+
# Install required dependencies
45
RUN apk --no-cache add libsass-dev pcre
56

7+
# Set working directory for Nitter source code
68
WORKDIR /src/nitter
79

10+
# Copy the nimble file and install dependencies
811
COPY nitter.nimble .
912
RUN nimble install -y --depsOnly
1013

14+
# Copy the rest of the source code
1115
COPY . .
16+
17+
# Build the Nitter binary and handle other necessary tasks
1218
RUN nimble build -d:danger -d:lto -d:strip \
1319
&& nimble scss \
1420
&& nimble md
1521

22+
# Stage 2: Set up the final image
1623
FROM alpine:latest
24+
25+
# Set working directory
1726
WORKDIR /src/
27+
28+
# Install runtime dependencies
1829
RUN apk --no-cache add pcre ca-certificates
30+
31+
# Copy the built Nitter binary and necessary files from the previous stage
1932
COPY --from=nim /src/nitter/nitter ./
2033
COPY --from=nim /src/nitter/nitter.example.conf ./nitter.conf
2134
COPY --from=nim /src/nitter/public ./public
35+
36+
# Expose the required port
2237
EXPOSE 8080
38+
39+
# Create a non-root user and set it as the owner of the application
2340
RUN adduser -h /src/ -D -s /bin/sh nitter
2441
USER nitter
42+
43+
# Set the command to run the application
2544
CMD ./nitter

0 commit comments

Comments
 (0)