Justfile build and dev targets, working containerfile
This commit is contained in:
parent
7c65c54e61
commit
2b1e350ce1
4 changed files with 30 additions and 1 deletions
21
justfile
Normal file
21
justfile
Normal file
|
@ -0,0 +1,21 @@
|
|||
dev:
|
||||
cd client && npm run dev
|
||||
|
||||
build-client:
|
||||
cd client && npm install
|
||||
cd client && npm run build
|
||||
|
||||
# npm run build places the build in the server/public directory
|
||||
build-container: build-client
|
||||
cd server && podman build -t server .
|
||||
|
||||
start-release: build-container
|
||||
podman run -d -p 8080:8080 --name frostbyte server
|
||||
|
||||
clean:
|
||||
podman container rm -f frostbyte
|
||||
podman image rm -f server
|
||||
rm -rf client/dist
|
||||
rm -rf client/node_modules
|
||||
rm -rf server/public
|
||||
rm -rf server/target
|
1
server/.containerignore
Normal file
1
server/.containerignore
Normal file
|
@ -0,0 +1 @@
|
|||
target
|
7
server/Containerfile
Normal file
7
server/Containerfile
Normal file
|
@ -0,0 +1,7 @@
|
|||
FROM docker.io/rust:latest as builder
|
||||
workdir /app
|
||||
ADD . /app
|
||||
RUN cargo clean
|
||||
RUN cargo build --release
|
||||
EXPOSE 8080
|
||||
CMD ["cargo", "run", "--release"]
|
|
@ -35,7 +35,7 @@ async fn main() -> std::io::Result<()> {
|
|||
)
|
||||
.service(Files::new("/", "./public").index_file("index.html"))
|
||||
})
|
||||
.bind("localhost:8080")?
|
||||
.bind("0.0.0.0:8080")?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue