15
15
# along with this program. If not, see <https://www.gnu.org/licenses/>.
16
16
# Use an official Python runtime as a parent image
17
17
# Using slim variant for smaller size
18
- # DockFlare: Automates Cloudflare Tunnel ingress from Docker labels.
19
- # Copyright (C) 2025 ChrispyBacon-Dev <https://github.com/ChrispyBacon-dev/DockFlare>
20
- # (License header remains the same)
21
- # --- Frontend Builder Stage ---
22
18
FROM node:20-alpine as frontend-builder
23
19
LABEL stage=frontend-builder
24
- WORKDIR /build # Changed WORKDIR to something simple for this stage
25
-
26
- # Copy files needed for the build from the 'dockflare' subdirectory of the build context
27
- COPY ./dockflare/package.json ./package.json
28
- COPY ./dockflare/package-lock.json* ./
29
- COPY ./dockflare/tailwind.config.js ./tailwind.config.js
30
- COPY ./dockflare/postcss.config.js ./postcss.config.js
31
-
32
- # Create the expected directory structure for input.css and templates
33
- # relative to the WORKDIR (/build)
34
- RUN mkdir -p ./app/templates
35
- COPY ./dockflare/app/templates/input.css ./app/templates/input.css
36
- COPY ./dockflare/app/templates ./app/templates
37
-
20
+ WORKDIR /usr/src/app
21
+ COPY package.json ./
22
+ COPY package-lock.json* ./
38
23
RUN npm install
39
-
40
- RUN echo ">>> Current directory before npm run build:css is $(pwd)" && \
41
- echo ">>> Listing WORKDIR (/build) contents:" && \
42
- ls -la . && \
43
- echo ">>> Listing ./app/ contents:" && \
44
- ls -la ./app/ && \
45
- echo ">>> Listing ./app/templates/ contents:" && \
46
- ls -la ./app/templates/ && \
47
- echo ">>> Running npm run build:css..." && \
48
- npm run build:css
49
-
50
- RUN echo ">>> CSS build supposedly complete. Verifying output..." && \
51
- echo ">>> Listing /build/app/ :" && \
52
- ls -la /build/app/ && \
53
- echo ">>> Listing /build/app/static/ :" && \
54
- ls -la /build/app/static/ && \
55
- echo ">>> Listing /build/app/static/css/ :" && \
56
- ls -la /build/app/static/css/ && \
57
- echo ">>> Checking for /build/app/static/css/output.css existence:" && \
58
- (test -f /build/app/static/css/output.css && echo "output.css FOUND" || echo "output.css NOT FOUND" )
59
- # End of frontend-builder stage
60
-
61
- # --- Runtime Stage ---
24
+ COPY tailwind.config.js ./
25
+ COPY postcss.config.js ./
26
+ COPY ./templates/input.css ./templates/input.css
27
+ COPY ./templates ./templates
28
+ RUN npm run build:css
62
29
FROM python:3.13-slim as runtime
63
30
ENV PYTHONDONTWRITEBYTECODE=1
64
31
ENV PYTHONUNBUFFERED=1
65
32
WORKDIR /app
66
33
ENV CLOUDFLARED_VERSION="2024.1.5"
67
- # ... (cloudflared install) ...
68
34
RUN apt-get update && apt-get install -y --no-install-recommends \
69
35
wget \
70
36
ca-certificates \
@@ -82,13 +48,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
82
48
rm cloudflared-$CLOUDFLARED_ARCH.deb && \
83
49
cloudflared --version && \
84
50
mkdir -p /root/.cloudflared
85
-
86
- COPY ./dockflare/requirements.txt .
51
+ COPY requirements.txt .
87
52
RUN pip install --no-cache-dir -r requirements.txt
88
-
89
- COPY --from=frontend-builder /build/app/static/css/output.css /app/static/css/output.css
90
-
91
- COPY ./dockflare/app /app
92
- COPY ./images /app/static/images/
53
+ RUN mkdir -p /app/static/css
54
+ RUN mkdir -p /app/static/images
55
+ COPY --from=frontend-builder /usr/src/app/static/css/output.css /app/static/css/output.css
56
+ COPY app.py .
57
+ COPY templates /app/templates/
58
+ COPY images /app/static/images/
93
59
EXPOSE 5000
94
- CMD ["python" , "main .py" ]
60
+ CMD ["python" , "app .py" ]
0 commit comments