-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (26 loc) · 866 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM node:latest AS tailwind-builder
WORKDIR /tailwind
RUN npm init -y && \
npm install tailwindcss && \
npx tailwind init
COPY ./templates /templates
COPY ./tailwind/tailwind.config.js /src/tailwind.config.js
COPY ./tailwind/styles.css /src/styles.css
RUN npx tailwindcss -c /src/tailwind.config.js -i /src/styles.css -o /styles.css --minify
# Start with the official GoLang base image
FROM golang:alpine AS builder
# Set the working directory inside the container
WORKDIR /app
# Copy the GoLang source code to the container
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Build the GoLang application inside the container
RUN go build -v -o ./server ./cmd/server/
FROM alpine
WORKDIR /app
COPY ./assets ./assets
COPY .env .env
COPY --from=builder /app/server ./server
COPY --from=tailwind-builder /styles.css /app/assets/styles.css
CMD ./server