mirror of
https://github.com/usatiuk/photos.git
synced 2025-10-28 15:27:49 +01:00
make docker image smaller
This commit is contained in:
@@ -3,3 +3,4 @@ npm-debug.log
|
||||
|
||||
frontend/node_modules
|
||||
frontend/npm-debug.log
|
||||
frontend/.parcel-cache
|
||||
|
||||
26
Dockerfile
26
Dockerfile
@@ -1,21 +1,25 @@
|
||||
# might fix this? https://github.com/parcel-bundler/parcel/issues/6735
|
||||
FROM node:16-bullseye
|
||||
FROM node:16-bullseye as frontbuild
|
||||
|
||||
WORKDIR /usr/src/app/frontend
|
||||
COPY ./frontend/package*.json ./
|
||||
RUN npm ci --only=production
|
||||
COPY ./ ../
|
||||
RUN npm run build && bash -O extglob -c 'rm -rfv !("dist")'
|
||||
WORKDIR ../
|
||||
RUN bash -O extglob -c 'rm -rfv !("frontend")'
|
||||
|
||||
FROM node:16-alpine as backexceptwithoutfrontend
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
COPY package*.json ./
|
||||
RUN npm ci --only=production
|
||||
COPY ./ ./
|
||||
RUN rm -rfv frontend
|
||||
|
||||
RUN mkdir frontend
|
||||
WORKDIR frontend
|
||||
COPY ./frontend/package*.json ./
|
||||
RUN npm ci --only=production
|
||||
WORKDIR ../
|
||||
FROM backexceptwithoutfrontend
|
||||
|
||||
COPY . .
|
||||
|
||||
WORKDIR frontend
|
||||
RUN npm run build
|
||||
WORKDIR ../
|
||||
COPY --from=frontbuild /usr/src/app/frontend .
|
||||
|
||||
#ENV PORT=8080
|
||||
#ENV TYPEORM_HOST=localhost
|
||||
|
||||
987
package-lock.json
generated
987
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
37
package.json
37
package.json
@@ -24,23 +24,10 @@
|
||||
"dependencies": {
|
||||
"@koa/cors": "^3.4.1",
|
||||
"@koa/router": "^12.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.48.1",
|
||||
"@typescript-eslint/parser": "^5.48.1",
|
||||
"bcrypt": "^5.1.0",
|
||||
"chai": "^4.3.7",
|
||||
"class-validator": "^0.14.0",
|
||||
"concurrently": "^7.6.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"deasync": "^0.1.28",
|
||||
"eslint": "^8.31.0",
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"eslint-import-resolver-typescript": "^3.5.3",
|
||||
"eslint-plugin-import": "^2.27.4",
|
||||
"eslint-plugin-mocha": "^10.1.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"exifreader": "^4.9.1",
|
||||
"hasha": "^5.2.2",
|
||||
"husky": "^8.0.3",
|
||||
"jsonwebtoken": "^9.0.0",
|
||||
"koa": "^2.14.1",
|
||||
"koa-body": "^5.0.0",
|
||||
@@ -50,14 +37,9 @@
|
||||
"koa-sslify": "^5.0.1",
|
||||
"koa-static": "^5.0.0",
|
||||
"mime-types": "^2.1.35",
|
||||
"mocha": "^10.2.0",
|
||||
"mysql": "^2.18.1",
|
||||
"prettier": "^2.8.2",
|
||||
"prettier-eslint": "^15.0.1",
|
||||
"sharp": "^0.31.3",
|
||||
"supertest": "^6.3.3",
|
||||
"ts-node": "^10.9.1",
|
||||
"ts-node-dev": "^2",
|
||||
"tsconfig-paths": "^4.1.2",
|
||||
"typeorm": "^0.2.41",
|
||||
"typescript": "^4.9.4"
|
||||
@@ -83,8 +65,25 @@
|
||||
"@types/prettier": "^2.7.2",
|
||||
"@types/sharp": "^0.31.1",
|
||||
"@types/supertest": "^2.0.12",
|
||||
"@typescript-eslint/eslint-plugin": "^5.48.1",
|
||||
"@typescript-eslint/parser": "^5.48.1",
|
||||
"chai": "^4.3.7",
|
||||
"concurrently": "^7.6.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^8.31.0",
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"eslint-import-resolver-typescript": "^3.5.3",
|
||||
"eslint-plugin-import": "^2.27.4",
|
||||
"eslint-plugin-mocha": "^10.1.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"husky": "^8.0.3",
|
||||
"mocha": "^10.2.0",
|
||||
"mocha-junit-reporter": "^2.2.0",
|
||||
"mocha-multi-reporters": "^1.5.1"
|
||||
"mocha-multi-reporters": "^1.5.1",
|
||||
"prettier": "^2.8.2",
|
||||
"prettier-eslint": "^15.0.1",
|
||||
"supertest": "^6.3.3",
|
||||
"ts-node-dev": "^2"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import deasync = require("deasync");
|
||||
import { fromFile } from "hasha";
|
||||
import * as ExifReader from "exifreader";
|
||||
import * as sharp from "sharp";
|
||||
@@ -72,8 +71,3 @@ export async function fileCheck(file: string) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||
export const getHashSync: (file: string) => string = deasync(getHash);
|
||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||
export const getSizeSync: (file: string) => string = deasync(getSize);
|
||||
|
||||
Reference in New Issue
Block a user