docker frontend cache doesn't depend on backend

This commit is contained in:
2023-01-15 13:11:25 +01:00
parent a2cdbdef7f
commit 593e2181f2
6 changed files with 6 additions and 5 deletions

View File

@@ -112,7 +112,7 @@ jobs:
- run: - run:
name: build and push to docker hub name: build and push to docker hub
command: docker buildx build --push --platform linux/arm64,linux/amd64 --tag stepanusatiuk/photos:$CIRCLE_BRANCH . command: docker buildx build --progress=plain --push --platform linux/arm64,linux/amd64 --tag stepanusatiuk/photos:$CIRCLE_BRANCH .
#command: docker buildx build --push --platform linux/amd64 --tag stepanusatiuk/photos:$CIRCLE_BRANCH . #command: docker buildx build --push --platform linux/amd64 --tag stepanusatiuk/photos:$CIRCLE_BRANCH .
# build-arm: # build-arm:

View File

@@ -4,7 +4,8 @@ FROM node:16-bullseye as frontbuild
WORKDIR /usr/src/app/frontend WORKDIR /usr/src/app/frontend
COPY ./frontend/package*.json ./ COPY ./frontend/package*.json ./
RUN npm ci --only=production RUN npm ci --only=production
COPY ./ ../ COPY ./frontend .
COPY ./src/shared ../src/shared
RUN npm run build && bash -O extglob -c 'rm -rfv !("dist")' RUN npm run build && bash -O extglob -c 'rm -rfv !("dist")'
WORKDIR ../ WORKDIR ../
RUN bash -O extglob -c 'rm -rfv !("frontend")' RUN bash -O extglob -c 'rm -rfv !("frontend")'

View File

@@ -42,7 +42,7 @@ import {
photoUploadSuccess, photoUploadSuccess,
} from "./actions"; } from "./actions";
import { IPhotosNewRespBody } from "../../../../src/routes/photos"; import { IPhotosNewRespBody } from "../../../../src/routes/photos";
import { IPhotosListPagination } from "../../../../src/types"; import { IPhotosListPagination } from "../../../../src/shared/types";
// Thanks, https://dev.to/qortex/compute-md5-checksum-for-a-file-in-typescript-59a4 // Thanks, https://dev.to/qortex/compute-md5-checksum-for-a-file-in-typescript-59a4
function computeChecksumMd5(file: File): Promise<string> { function computeChecksumMd5(file: File): Promise<string> {

View File

@@ -1,7 +1,7 @@
import * as Router from "@koa/router"; import * as Router from "@koa/router";
import { IPhotoReqJSON, Photo } from "~entity/Photo"; import { IPhotoReqJSON, Photo } from "~entity/Photo";
import { User } from "~entity/User"; import { User } from "~entity/User";
import { IAPIResponse, IPhotosListPagination } from "~types"; import { IAPIResponse, IPhotosListPagination } from "~/shared/types";
import * as fs from "fs/promises"; import * as fs from "fs/promises";
import send = require("koa-send"); import send = require("koa-send");
import { getHash, getSize } from "~util"; import { getHash, getSize } from "~util";

View File

@@ -1,7 +1,7 @@
import * as Router from "@koa/router"; import * as Router from "@koa/router";
import { getConfigValue, ConfigKey } from "~entity/Config"; import { getConfigValue, ConfigKey } from "~entity/Config";
import { IUserAuthJSON, IUserJWT, User } from "~entity/User"; import { IUserAuthJSON, IUserJWT, User } from "~entity/User";
import { IAPIResponse } from "~types"; import { IAPIResponse } from "~/shared/types";
export const userRouter = new Router(); export const userRouter = new Router();