Skip to content

Commit a28b384

Browse files
mayoootharry
and
harry
authored
feat: Add docker support (#185)
* feat: add docker support * docs: add docker start documentation --------- Co-authored-by: harry <[email protected]>
1 parent 126c6c8 commit a28b384

File tree

2 files changed

+28
-4
lines changed

2 files changed

+28
-4
lines changed

Dockerfile

+6-4
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@ WORKDIR /builder
99
RUN rustup default nightly
1010
RUN cargo build --release
1111

12-
FROM ubuntu
12+
FROM debian:12.5-slim
13+
14+
RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free" > /etc/apt/sources.list && \
15+
echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free" >> /etc/apt/sources.list
16+
RUN apt-get update && apt-get install -y postgresql-client
1317

1418
ARG APP_SERVER=fnck_sql
1519

1620
WORKDIR /fnck_sql
1721

18-
ENV IP="127.0.0.1"
19-
2022
EXPOSE 5432
2123

2224
COPY --from=builder /builder/target/release/${APP_SERVER} ${APP_SERVER}
2325

24-
ENTRYPOINT ["./fnck_sql"]
26+
ENTRYPOINT ["./fnck_sql", "--ip", "0.0.0.0"]

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,28 @@ let tuples = fnck_sql.run("select * from t1").await?;
5959
Storage Support:
6060
- KipDB
6161

62+
### Docker
63+
#### Build From Source
64+
~~~shell
65+
git clone https://github.com/KipData/FnckSQL.git
66+
cd FnckSQL
67+
docker build -t fncksql:latest .
68+
~~~
69+
70+
We installed the `psql` tool in the image for easy debug.
71+
72+
You can use `psql -h 127.0.0.1 -p 5432` to do this.
73+
74+
~~~shell
75+
docker run -d \
76+
--name=fncksql \
77+
-p 5432:5432 \
78+
--restart=always \
79+
-v fncksql-data:/fnck_sql/fncksql_data \
80+
-v /etc/localtime:/etc/localtime:ro \
81+
fncksql:latest
82+
~~~
83+
6284
### Features
6385
- ORM Mapping: `features = ["marcos"]`
6486
```rust

0 commit comments

Comments
 (0)