Spaces:
Runtime error
Runtime error
✨ Docker compose for development (#336)
Browse files* feat: development docker compose
* chore: update readme.md to mention docker compose
* refactor: requested change
* revert: README.md
---------
Co-authored-by: alamin655 <[email protected]>
- dev.Dockerfile +15 -0
- dev.docker-compose.yml +26 -0
dev.Dockerfile
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Create Builder image
|
2 |
+
FROM --platform=$BUILDPLATFORM rust:1.73.0-alpine3.18
|
3 |
+
|
4 |
+
# Install required dependencies
|
5 |
+
RUN apk add --no-cache alpine-sdk musl-dev g++ make libcrypto3 libressl-dev perl build-base
|
6 |
+
|
7 |
+
RUN cargo install cargo-watch --locked
|
8 |
+
|
9 |
+
# Create project directory
|
10 |
+
RUN mkdir -p /project
|
11 |
+
WORKDIR /project
|
12 |
+
|
13 |
+
ENV RUSTFLAGS="-C target-feature=-crt-static"
|
14 |
+
|
15 |
+
ENTRYPOINT ["cargo"]
|
dev.docker-compose.yml
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
version: "3.9"
|
3 |
+
services:
|
4 |
+
redis:
|
5 |
+
container_name: redis
|
6 |
+
image: redis:6.2.5-alpine
|
7 |
+
tty: true
|
8 |
+
hostname: surfx-redis
|
9 |
+
websurx:
|
10 |
+
container_name: websurx-dev
|
11 |
+
image: websurfx:dev
|
12 |
+
working_dir: /project
|
13 |
+
tty: true
|
14 |
+
build:
|
15 |
+
context: .
|
16 |
+
dockerfile: dev.Dockerfile
|
17 |
+
ports:
|
18 |
+
- 8080:8080
|
19 |
+
volumes:
|
20 |
+
- type: bind
|
21 |
+
source: .
|
22 |
+
target: /project
|
23 |
+
command:
|
24 |
+
- watch
|
25 |
+
- -x
|
26 |
+
- run
|