diff --git a/.gitignore b/.gitignore index d511fa5ad..ff2b4f8cb 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,9 @@ coverage !/.config/example.yml !/.config/docker_example.env +#docker dev config +/dev/docker-compose.yml + # misskey /build built diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml.example similarity index 86% rename from dev/docker-compose.yml rename to dev/docker-compose.yml.example index 07f04451d..0ab9f264c 100644 --- a/dev/docker-compose.yml +++ b/dev/docker-compose.yml.example @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index 850394f70..d5ed78ac7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/packages/backend/src/services/drive/add-file.ts b/packages/backend/src/services/drive/add-file.ts index a790fd510..47b19e23a 100644 --- a/packages/backend/src/services/drive/add-file.ts +++ b/packages/backend/src/services/drive/add-file.ts @@ -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)) { diff --git a/packages/client/src/scripts/upload.ts b/packages/client/src/scripts/upload.ts index 714c98d6a..b1562f4a6 100644 --- a/packages/client/src/scripts/upload.ts +++ b/packages/client/src/scripts/upload.ts @@ -18,7 +18,7 @@ export const uploads = ref([]); 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;