File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 1+ # Stage 1: Build Nitter from the nimlang image
12FROM nimlang/nim:2.0.0-alpine-regular as nim
2- LABEL maintainer="setenforce@protonmail.com"
33
4+ # Install required dependencies
45RUN apk --no-cache add libsass-dev pcre
56
7+ # Set working directory for Nitter source code
68WORKDIR /src/nitter
79
10+ # Copy the nimble file and install dependencies
811COPY nitter.nimble .
912RUN nimble install -y --depsOnly
1013
14+ # Copy the rest of the source code
1115COPY . .
16+
17+ # Build the Nitter binary and handle other necessary tasks
1218RUN nimble build -d:danger -d:lto -d:strip \
1319 && nimble scss \
1420 && nimble md
1521
22+ # Stage 2: Set up the final image
1623FROM alpine:latest
24+
25+ # Set working directory
1726WORKDIR /src/
27+
28+ # Install runtime dependencies
1829RUN apk --no-cache add pcre ca-certificates
30+
31+ # Copy the built Nitter binary and necessary files from the previous stage
1932COPY --from=nim /src/nitter/nitter ./
2033COPY --from=nim /src/nitter/nitter.example.conf ./nitter.conf
2134COPY --from=nim /src/nitter/public ./public
35+
36+ # Expose the required port
2237EXPOSE 8080
38+
39+ # Create a non-root user and set it as the owner of the application
2340RUN adduser -h /src/ -D -s /bin/sh nitter
2441USER nitter
42+
43+ # Set the command to run the application
2544CMD ./nitter
You can’t perform that action at this time.
0 commit comments