add hot reload to docker
This commit is contained in:
parent
00a78f33b6
commit
fae5f783f3
|
@ -12,4 +12,4 @@ FROM dependencies AS build
|
|||
COPY . ./
|
||||
RUN npm run build -- --mode production
|
||||
|
||||
CMD [ "node", "/app" ]
|
||||
CMD [ "node", "build" ]
|
||||
|
|
|
@ -1,13 +1,24 @@
|
|||
services:
|
||||
server:
|
||||
build: ./server
|
||||
server: &server
|
||||
profiles:
|
||||
- prod
|
||||
build:
|
||||
context: ./server
|
||||
target: prod
|
||||
volumes:
|
||||
- ./server/target/debug:/app
|
||||
- ./fonts:/fonts
|
||||
ports:
|
||||
- 8000:8000
|
||||
|
||||
client:
|
||||
server-dev:
|
||||
profiles:
|
||||
- dev
|
||||
<<: *server
|
||||
build:
|
||||
context: ./server
|
||||
target: dev
|
||||
|
||||
client: &client
|
||||
profiles:
|
||||
- prod
|
||||
build:
|
||||
|
@ -22,7 +33,6 @@ services:
|
|||
build:
|
||||
context: ./client
|
||||
target: dev
|
||||
<<: *client
|
||||
volumes:
|
||||
- ./client:/app
|
||||
ports:
|
||||
- 80:3000
|
||||
|
|
|
@ -1,8 +1,17 @@
|
|||
FROM debian:bookworm-slim
|
||||
FROM rust:bookworm AS builder
|
||||
|
||||
WORKDIR /app
|
||||
VOLUME /build
|
||||
WORKDIR /build
|
||||
|
||||
VOLUME /app
|
||||
FROM builder AS dev
|
||||
RUN cargo install cargo-watch
|
||||
CMD [ "cargo", "watch", "-x", "run" ]
|
||||
|
||||
FROM builder AS build
|
||||
COPY . .
|
||||
RUN cargo install --path /build
|
||||
|
||||
FROM debian:bookworm-slim AS prod
|
||||
COPY --from=build /usr/local/cargo/bin/webview /app/webview
|
||||
VOLUME /fonts
|
||||
|
||||
CMD [ "/app/webview" ]
|
||||
|
|
Loading…
Reference in a new issue