Changed routing framework from mux to Gin.

Swagger doc is now included in the application.
A fronted can now be hosted from the application.
This commit is contained in:
2022-01-29 17:52:33 +01:00
parent 512fcd0c4f
commit f9d6c24a97
43 changed files with 28760 additions and 210 deletions

View File

@@ -1,13 +1,32 @@
FROM node:lts-alpine as build_vue
# make the 'app' folder the current working directory
WORKDIR /app
# copy both 'package.json' and 'package-lock.json' (if available)
COPY cmd/frontend/package*.json ./
# install project dependencies
RUN npm install
COPY cmd/frontend .
RUN npm run build
FROM golang:1.16-alpine as build_go
COPY go.* /music-server/
COPY ./cmd /music-server/cmd/
COPY ./cmd/*.go /music-server/cmd/
COPY ./cmd/swagger /music-server/cmd/swagger
COPY ./pkg /music-server/pkg/
WORKDIR /music-server/
RUN go mod download
WORKDIR /music-server/cmd/backend
WORKDIR /music-server/cmd
COPY --from=build_vue /app/dist ./frontend/dist
RUN go build -o /music-server/MusicServer
# Stage 2, distribution container