diff --git a/dev.Dockerfile b/dev.Dockerfile new file mode 100644 index 0000000..412283e --- /dev/null +++ b/dev.Dockerfile @@ -0,0 +1,15 @@ +# Create Builder image +FROM --platform=$BUILDPLATFORM rust:1.73.0-alpine3.18 + +# Install required dependencies +RUN apk add --no-cache alpine-sdk musl-dev g++ make libcrypto3 libressl-dev perl build-base + +RUN cargo install cargo-watch --locked + +# Create project directory +RUN mkdir -p /project +WORKDIR /project + +ENV RUSTFLAGS="-C target-feature=-crt-static" + +ENTRYPOINT ["cargo"] diff --git a/dev.docker-compose.yml b/dev.docker-compose.yml new file mode 100644 index 0000000..f242849 --- /dev/null +++ b/dev.docker-compose.yml @@ -0,0 +1,26 @@ +--- +version: "3.9" +services: + redis: + container_name: redis + image: redis:6.2.5-alpine + tty: true + hostname: surfx-redis + websurx: + container_name: websurx-dev + image: websurfx:dev + working_dir: /project + tty: true + build: + context: . + dockerfile: dev.Dockerfile + ports: + - 8080:8080 + volumes: + - type: bind + source: . + target: /project + command: + - watch + - -x + - run