server: add devcontainer
This commit is contained in:
parent
de55283839
commit
ac63fd8349
14
skycraft/server/Dockerfile
Normal file
14
skycraft/server/Dockerfile
Normal file
@ -0,0 +1,14 @@
|
||||
FROM rust:1.80.1 AS build
|
||||
|
||||
RUN apt-get update && apt-get install -y lld
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
COPY src /workspace/src
|
||||
COPY Cargo.toml /workspace/
|
||||
COPY Cargo.lock /workspace/
|
||||
|
||||
RUN cargo build
|
||||
|
||||
|
||||
FROM build AS dev
|
19
skycraft/server/Makefile
Normal file
19
skycraft/server/Makefile
Normal file
@ -0,0 +1,19 @@
|
||||
dev-image:
|
||||
docker build -t cargo-server-dev --target dev .
|
||||
|
||||
.PHONY: dev
|
||||
dev: dev-image ## Start a dev container
|
||||
docker run -it --rm \
|
||||
-v $(CURDIR)/src:/workspace/src \
|
||||
-v $(CURDIR)/Cargo.toml:/workspace/Cargo.toml \
|
||||
-v $(CURDIR)/Cargo.lock:/workspace/Cargo.lock \
|
||||
-p 127.0.0.1:8080:8080 \
|
||||
cargo-server-dev \
|
||||
bash
|
||||
|
||||
|
||||
.PHONY: help
|
||||
help: ## Show this help
|
||||
@echo Noteworthy targets:
|
||||
@egrep '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
||||
.DEFAULT_GOAL := help
|
Loading…
Reference in New Issue
Block a user