-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from FACorreiaa/feature/migrate-cdns-to-packag…
…ejson change package json file and add pines ui
- Loading branch information
Showing
18 changed files
with
7,513 additions
and
3,992 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,34 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# Build. | ||
FROM golang:1.22 AS build-stage | ||
|
||
LABEL Author="FC a11199" | ||
|
||
FROM node:latest as assets | ||
WORKDIR /app | ||
COPY package.json ./ | ||
COPY package-lock.json ./ | ||
COPY postcss.config.cjs ./ | ||
COPY fonts.css ./ | ||
RUN mkdir -p app/static/css app/static/fonts | ||
RUN npm install --ci | ||
RUN npm run fonts | ||
RUN npm run tailwind-build | ||
|
||
# Define the "base" stage | ||
FROM golang:latest as base | ||
WORKDIR /app | ||
COPY go.mod go.sum ./ | ||
COPY go.mod ./ | ||
COPY go.sum ./ | ||
RUN go mod download | ||
COPY . /app | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -gcflags "all=-N -l" -o /entrypoint ./*.go | ||
|
||
FROM build-stage AS app-dev | ||
#we test | ||
#RUN curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-arm64 | ||
#RUN chmod +x tailwindcss-linux-arm64 | ||
#RUN mv tailwindcss-linux-arm64 tailwindcss | ||
COPY . . | ||
|
||
# Define the "dev" stage | ||
FROM base as app-dev | ||
RUN curl -sSfL https://raw.githubusercontent.com/cosmtrek/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin | ||
RUN GOOS=linux go install github.com/a-h/templ/cmd/templ@latest | ||
WORKDIR /app | ||
RUN go install github.com/a-h/templ/cmd/templ@latest | ||
RUN templ generate | ||
CMD ["air"] | ||
|
||
FROM build-stage AS app-debug | ||
RUN CGO_ENABLED=0 go install github.com/go-delve/delve/cmd/dlv@latest | ||
WORKDIR /app | ||
|
||
# Deploy. | ||
FROM gcr.io/distroless/static-debian11 AS release-stage | ||
WORKDIR / | ||
COPY --from=build-stage /entrypoint /entrypoint | ||
COPY --from=build-stage /app/app/static /app/static | ||
|
||
COPY ./config /app/config | ||
# COPY .env.compose . | ||
EXPOSE 8080 | ||
USER nonroot:nonroot | ||
ENTRYPOINT ["/entrypoint"] | ||
# Define the final stage | ||
FROM base as final | ||
COPY --from=assets /app/controller/static/css/* ./controller/static/css/ | ||
COPY --from=assets /app/controller/static/fonts/* ./controller/static/fonts/ | ||
RUN CGO_ENABLED=0 go build -o /app/server | ||
EXPOSE 6969 | ||
ENTRYPOINT ["/app/server"] |
Oops, something went wrong.