Skip to content

Commit

Permalink
fix: dockerfile with web directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Brereton authored and Tom Brereton committed Jan 10, 2024
1 parent 69292ca commit 8bb77a3
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# Node.js stage for Tailwind CSS
FROM node:latest as tailwindbuilder

WORKDIR /web
WORKDIR /node

COPY static/ ./static/
COPY templates/ ./templates/
COPY web ./web
COPY package*.json .
COPY tailwind.config.js .
RUN ls -l /web
RUN npm install
RUN npx tailwindcss -i ./static/css/main.css -o ./static/css/styles.css --minify
RUN npx tailwindcss -i ./web/static/css/main.css -o ./web/static/css/styles.css --minify

# Go build stage
FROM golang:latest as gobuilder
Expand All @@ -25,14 +23,13 @@ FROM alpine:latest

ENV PORT=3001 \
IS_DEVELOPMENT=false \
TEMPLATES_DIR=templates/ \
STATIC_DIR=./static
TEMPLATES_DIR=web/templates/ \
STATIC_DIR=./web/static

WORKDIR /root/

COPY --from=gobuilder /app/cmd/web/main .
COPY --from=tailwindbuilder /web/static/ ./static/
COPY --from=tailwindbuilder /web/templates/ ./templates/
COPY --from=tailwindbuilder /node/web/ ./web/

EXPOSE 3001
CMD ["./main"]

0 comments on commit 8bb77a3

Please sign in to comment.