Skip to content

Commit 65b18e2

Browse files
authored
Fix DNS issue, removed the fixed IPs workaround (#24)
* Bump mysql_async_wasi to 0.31.5
1 parent 31bae7f commit 65b18e2

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ anyhow = "1.0"
88
serde_json = "1.0"
99
serde = { version = "1.0", features = ["derive"] }
1010
url = "2.3"
11-
mysql_async_wasi = "0.31"
11+
mysql_async_wasi = "=0.31.5"
1212
hyper_wasi = { version = "0.15", features = ["full"] }
13-
tokio_wasi = { version = "1", features = ["io-util", "fs", "net", "time", "rt", "macros"] }
13+
tokio_wasi = { version = "1", features = ["io-util", "fs", "net", "time", "rt", "macros"] }

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN <<EOT bash
88
EOT
99

1010
FROM buildbase AS build
11-
COPY Cargo.toml orders.json update_order.json .
11+
COPY Cargo.toml orders.json update_order.json ./
1212
COPY src ./src
1313
# Build the Wasm binary
1414
RUN cargo build --target wasm32-wasi --release

docker-compose.yml

+1-17
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ services:
55
- 8090:80
66
volumes:
77
- ./client:/usr/share/nginx/html
8-
networks:
9-
fixed:
10-
ipv4_address: 172.20.0.3
118
server:
129
image: demo-microservice
1310
platform: wasi/wasm
@@ -16,25 +13,12 @@ services:
1613
ports:
1714
- 8080:8080
1815
environment:
19-
DATABASE_URL: mysql://root:whalehello@172.20.0.5:3306/mysql
16+
DATABASE_URL: mysql://root:whalehello@db:3306/mysql
2017
RUST_BACKTRACE: full
2118
DNS_SERVER: 127.0.0.11:53
2219
restart: unless-stopped
2320
runtime: io.containerd.wasmedge.v1
24-
networks:
25-
fixed:
26-
ipv4_address: 172.20.0.4
2721
db:
2822
image: mariadb:10.9
2923
environment:
3024
MYSQL_ROOT_PASSWORD: whalehello
31-
networks:
32-
fixed:
33-
ipv4_address: 172.20.0.5
34-
networks:
35-
fixed:
36-
driver: bridge
37-
ipam:
38-
driver: default
39-
config:
40-
- subnet: 172.20.0.0/16

0 commit comments

Comments
 (0)