-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (31 loc) · 1.45 KB
/
Dockerfile
File metadata and controls
45 lines (31 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#FROM node:18.18.2-alpine3.18 as build-stage
FROM node:18.18.2-bullseye-slim as build-svg
COPY musescore_3.6.2.AppImage /musescore.AppImage
# Instalando dependências para rodar musescore cli
RUN apt-get update -y && apt-get install -y jq libegl-dev libasound2 libjack0 librust-gobject-sys-dev libnss3 xvfb
# Extraindo arquivos do musescore
RUN /musescore.AppImage --appimage-extract
COPY public/collection/ /collection/
# Gerando json para conversão de midias com musescore
RUN find /collection/ -type f -name "*.mscz" | jq -R -s -c 'split("\n") | map(select(.!="") | sub(".mscz";"") | {"in":"\(.).mscz", "out": [[ "\(.)_",".svg"],[ "\(.)_",".midi"],"\(.).midi","\(.).metajson"]})' > media-generation.json
# Gerando mídias e metajson
RUN xvfb-run /squashfs-root/AppRun -j /media-generation.json
# Removendo arquivos não utilizados
RUN find /collection/* -type f ! -name '*.svg' -a ! -name '*.json' -a ! -name '*.metajson' -delete
FROM node:18.18.2-bullseye-slim as build-node
WORKDIR /app
COPY package.json /app
RUN npm install
COPY src/ /app/src
COPY --from=build-svg /collection /collection
COPY public/assets /app/public/assets
COPY tsconfig.json /app
COPY tsconfig.node.json /app
COPY vite.config.ts /app
COPY index.html /app
COPY scripts /app/scripts
RUN npm run index-collection -- -i /collection -o /app/public/collection
RUN npm run build
# #FROM node:18.18.2-alpine3.18
FROM nginx:1.25.3-alpine3.18-slim
COPY --from=build-node /app/dist /usr/share/nginx/html