Merge remote-tracking branch 'chimiana/develop' into develop
This commit is contained in:
commit
0cc74b6a8d
5 changed files with 18 additions and 3 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -33,6 +33,9 @@ coverage
|
|||
!/.config/example.yml
|
||||
!/.config/docker_example.env
|
||||
|
||||
#docker dev config
|
||||
/dev/docker-compose.yml
|
||||
|
||||
# misskey
|
||||
/build
|
||||
built
|
||||
|
|
|
@ -4,6 +4,7 @@ services:
|
|||
web:
|
||||
image: docker.io/thatonecalculator/calckey
|
||||
build: ..
|
||||
container_name: calckey_web
|
||||
restart: always
|
||||
depends_on:
|
||||
- db
|
||||
|
@ -13,12 +14,14 @@ services:
|
|||
- "3000:3000"
|
||||
networks:
|
||||
- network
|
||||
# - web
|
||||
volumes:
|
||||
- ../files:/calckey/files
|
||||
- ../.config:/calckey/.config:ro
|
||||
|
||||
redis:
|
||||
restart: always
|
||||
container_name: calckey_redis
|
||||
image: docker.io/redis:7.0-alpine
|
||||
networks:
|
||||
- network
|
||||
|
@ -28,6 +31,7 @@ services:
|
|||
db:
|
||||
restart: always
|
||||
image: docker.io/postgres:13.9-alpine
|
||||
container_name: calckey_db
|
||||
networks:
|
||||
- network
|
||||
env_file:
|
||||
|
@ -48,3 +52,6 @@ services:
|
|||
|
||||
networks:
|
||||
network:
|
||||
# web:
|
||||
# external:
|
||||
# name: web
|
|
@ -3,6 +3,7 @@ version: "3"
|
|||
services:
|
||||
web:
|
||||
image: docker.io/thatonecalculator/calckey
|
||||
container_name: calckey_web
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- db
|
||||
|
@ -17,11 +18,12 @@ services:
|
|||
NODE_ENV: production
|
||||
volumes:
|
||||
- ./files:/calckey/files
|
||||
- ./config:/calckey/.config:ro
|
||||
- ./.config:/calckey/.config:ro
|
||||
|
||||
redis:
|
||||
restart: unless-stopped
|
||||
image: docker.io/redis:7.0-alpine
|
||||
container_name: calckey_redis
|
||||
networks:
|
||||
- calcnet
|
||||
volumes:
|
||||
|
@ -30,6 +32,7 @@ services:
|
|||
db:
|
||||
restart: unless-stopped
|
||||
image: docker.io/postgres:13.9-alpine
|
||||
container_name: calckey_db
|
||||
networks:
|
||||
- calcnet
|
||||
env_file:
|
||||
|
|
|
@ -217,8 +217,10 @@ export async function generateAlts(path: string, type: string, generateWeb: bool
|
|||
logger.info('creating web image');
|
||||
|
||||
try {
|
||||
if (['image/jpeg', 'image/webp'].includes(type)) {
|
||||
if (['image/jpeg'].includes(type)) {
|
||||
webpublic = await convertSharpToJpeg(img, 2048, 2048);
|
||||
} else if (['image/webp'].includes(type)) {
|
||||
webpublic = await convertSharpToPng(img, 2048, 2048);
|
||||
} else if (['image/png'].includes(type)) {
|
||||
webpublic = await convertSharpToPng(img, 2048, 2048);
|
||||
} else if (['image/svg+xml'].includes(type)) {
|
||||
|
|
|
@ -18,7 +18,7 @@ export const uploads = ref<Uploading[]>([]);
|
|||
|
||||
const compressTypeMap = {
|
||||
'image/jpeg': { quality: 0.85, mimeType: 'image/jpeg' },
|
||||
'image/webp': { quality: 0.85, mimeType: 'image/jpeg' },
|
||||
'image/webp': { quality: 0.85, mimeType: 'image/png' },
|
||||
'image/svg+xml': { quality: 1, mimeType: 'image/png' },
|
||||
} as const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue