Added support for profiling. Removed the pkg module altogether. Everything except old sync is now using code generated by sqlc.
37 lines
753 B
Docker
37 lines
753 B
Docker
FROM golang:1.23-alpine as build_go
|
|
RUN apk add --no-cache curl
|
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
RUN go install github.com/a-h/templ/cmd/templ@latest
|
|
RUN curl -sL https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64 -o tailwindcss
|
|
RUN chmod +x tailwindcss
|
|
|
|
RUN templ generate
|
|
RUN ./tailwindcss -i cmd/web/assets/css/input.css -o cmd/web/assets/css/output.css
|
|
RUN go build -o main cmd/main.go
|
|
|
|
# Stage 2, distribution container
|
|
FROM golang:1.23-alpine
|
|
EXPOSE 8080
|
|
VOLUME /sorted
|
|
VOLUME /frontend
|
|
|
|
ENV PORT 8080
|
|
ENV DB_HOST ""
|
|
ENV DB_PORT ""
|
|
ENV DB_USERNAME ""
|
|
ENV DB_PASSWORD ""
|
|
ENV DB_NAME ""
|
|
ENV MUSIC_PATH ""
|
|
|
|
COPY --from=build_go /app/main .
|
|
COPY ./songs/ ./songs/
|
|
|
|
CMD ./main
|