parent
949ea57dd9
commit
7499aea5cc
13
Dockerfile
13
Dockerfile
|
@ -22,14 +22,15 @@ ENV ENV_DOCKER=true
|
|||
# Copy dockerignore files
|
||||
COPY .dockerignore ./
|
||||
|
||||
COPY Makefile ./
|
||||
|
||||
# Install go deps using the cache
|
||||
COPY go.mod go.sum Makefile ./
|
||||
RUN --mount=type=cache,target=/go/pkg/mod/ \
|
||||
COPY go.mod go.sum ./
|
||||
RUN --mount=type=cache,target=/tmp/.go-build-cache \
|
||||
go mod download -x
|
||||
|
||||
# Install node deps
|
||||
COPY frontend/package.json frontend/package-lock.json frontend/
|
||||
# Set npm cache to /tmp/.npm-cache
|
||||
RUN npm config set cache /tmp/.npm-cache --global
|
||||
RUN --mount=type=cache,target=/tmp/.npm-cache \
|
||||
make install
|
||||
|
@ -38,8 +39,12 @@ RUN --mount=type=cache,target=/tmp/.npm-cache \
|
|||
COPY frontend frontend
|
||||
RUN make frontend
|
||||
|
||||
# Build backend
|
||||
COPY goshort.go ./
|
||||
COPY cmd cmd
|
||||
COPY internal internal
|
||||
|
||||
# Build the backend
|
||||
COPY . .
|
||||
RUN --mount=type=cache,target=/tmp/.go-build-cache \
|
||||
make backend
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user