Skip to content

Commit 7144862

Browse files
committed
fix the dockerfile for tailwind example
1 parent 7697833 commit 7144862

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

examples/tailwind/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
FROM node:20-alpine3.17 as tailwind
22

33
COPY . /app
4-
RUN npx tailwindcss -i /app/static/style.css -o build.css --minify
4+
5+
WORKDIR /app
6+
7+
RUN npx tailwindcss -i /app/static/style.css -o /app/build.css --minify
58

69
FROM ubuntu as prod
710

8-
ENV DEV false
11+
ENV DEV=false
912

1013
RUN apt-get update && apt-get install ucspi-tcp
1114

1215
EXPOSE 3000
1316

1417
COPY . /app
1518

16-
COPY --from=tailwind build.css /app/static/tailwind.css
19+
COPY --from=tailwind /app/build.css /app/static/tailwind.css
1720

1821
CMD [ "/app/start.sh" ]

start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cd "${0%/*}"
44

55
[[ -f 'config.sh' ]] && source config.sh
66

7-
if [[ ! -z "$TAILWIND" ]]; then
7+
if [[ "${DEV:-true}" == "true" ]] && [[ ! -z "$TAILWIND" ]]; then
88
npx tailwindcss -i ./static/style.css -o ./static/tailwind.css --watch=always 2>&1 \
99
| sed '/^[[:space:]]*$/d;s/^/[tailwind] /' &
1010
PID=$!

0 commit comments

Comments
 (0)