|
3 | 3 | # Build arguments |
4 | 4 | ARG KAMAL_DEPLOY_HOST |
5 | 5 | ARG SERVICESTACK_LICENSE |
| 6 | +ARG APP_PASSWORD |
6 | 7 | ARG SERVICE_LABEL |
7 | 8 |
|
8 | 9 | # 1. Build .NET app + Node.js apps |
@@ -30,9 +31,9 @@ COPY MyApp.ServiceModel ./MyApp.ServiceModel |
30 | 31 | WORKDIR /src/MyApp |
31 | 32 |
|
32 | 33 | # Download tailwindcss binary directly (avoiding sudo requirement in postinstall.js) |
33 | | -RUN curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64 \ |
34 | | - && chmod +x tailwindcss-linux-x64 \ |
35 | | - && mv tailwindcss-linux-x64 /usr/local/bin/tailwindcss |
| 34 | +RUN curl -sL https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64 \ |
| 35 | + -o /usr/local/bin/tailwindcss \ |
| 36 | + && chmod +x /usr/local/bin/tailwindcss |
36 | 37 | RUN npm run ui:build |
37 | 38 |
|
38 | 39 | # Build Next.js app |
@@ -67,18 +68,18 @@ RUN apt-get update \ |
67 | 68 | && apt-get clean \ |
68 | 69 | && rm -rf /var/lib/apt/lists/* |
69 | 70 |
|
70 | | -# Create unprivileged user for Node.js |
71 | | -RUN groupadd -r nodeuser && useradd -r -g nodeuser -s /bin/bash nodeuser |
| 71 | +# Create unprivileged user for Next.js |
| 72 | +RUN groupadd -r nextjs && useradd -r -g nextjs -s /bin/bash nextjs |
72 | 73 |
|
73 | | -# Copy published .NET app (owned by root, no access for nodeuser) |
74 | | -COPY --from=dotnet-build /src/MyApp/bin/Release/net10.0/publish ./api |
75 | | -RUN chmod -R 700 ./api && chown -R root:root ./api |
| 74 | +# Copy published .NET app (owned by root, no access for nextjs user) |
| 75 | +COPY --from=dotnet-build /src/MyApp/bin/Release/net10.0/publish ./dotnet |
| 76 | +RUN chmod -R 700 ./dotnet && chown -R root:root ./dotnet |
76 | 77 |
|
77 | | -# Copy built Next.js app (owned by nodeuser, read-only) |
78 | | -COPY --from=dotnet-build /src/MyApp.Client ./client |
79 | | -RUN chown -R nodeuser:nodeuser ./client && chmod -R 500 ./client |
| 78 | +# Copy built Next.js app (owned by nextjs user, read-only) |
| 79 | +COPY --from=dotnet-build /src/MyApp.Client ./nextjs |
| 80 | +RUN chown -R nextjs:nextjs ./nextjs && chmod -R 500 ./nextjs |
80 | 81 |
|
81 | | -# Create /tmp directory accessible to nodeuser |
| 82 | +# Create /tmp directory accessible to nextjs user |
82 | 83 | RUN mkdir -p /tmp && chmod 1777 /tmp |
83 | 84 |
|
84 | 85 | ENV ASPNETCORE_URLS=http://0.0.0.0:8080 \ |
|
0 commit comments