This commit is contained in:
parent
fb6972b430
commit
18df310d77
2 changed files with 15 additions and 2 deletions
11
Dockerfile
11
Dockerfile
|
@ -32,13 +32,20 @@ COPY --from=build /app/node_modules ./node_modules
|
|||
COPY --from=build /app/dist ./dist
|
||||
COPY --from=build /app/frontend/index.html ./dist/frontend/
|
||||
|
||||
COPY --from=build /app/package.json ./dist/backend/
|
||||
|
||||
COPY --from=rust-build /usr/local/cargo/bin/iching /usr/local/bin/iching
|
||||
|
||||
# Falls notwendig: Umbenennen von .js zu .mjs
|
||||
RUN find dist/frontend -name "*.js" -exec bash -c 'mv "$0" "${0%.js}.mjs"' {} \;
|
||||
|
||||
# Starte den Backend-Server
|
||||
CMD ["node", "--loader", "ts-node/esm", "/app/dist/backend/server.js"]
|
||||
#CMD ["node", "--loader", "ts-node/esm", "/app/dist/backend/server.js"]
|
||||
|
||||
# Starte den Frontend-Server
|
||||
CMD ["npx", "http-server", "dist/frontend", "-p", "8080", "--mime", "application/javascript=js"]
|
||||
#CMD ["npx", "http-server", "dist/frontend", "-p", "8080", "--mime", "application/javascript=js"]
|
||||
|
||||
COPY start.sh ./start.sh
|
||||
RUN chmod +x ./start.sh
|
||||
|
||||
CMD ["./start.sh"]
|
6
start.sh
Normal file
6
start.sh
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
# Starte Backend im Hintergrund
|
||||
node /app/dist/backend/server.js &
|
||||
|
||||
# Starte Frontend
|
||||
npx http-server dist/frontend -p 8080 --mime application/javascript=js
|
Loading…
Reference in a new issue