Skip to content

Commit

Permalink
Updated Dockerfile to support /var/lib/geoprox default config path
Browse files Browse the repository at this point in the history
  • Loading branch information
ezrasingh committed Aug 23, 2024
1 parent 87b1a21 commit dcb9c1a
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 7 deletions.
8 changes: 5 additions & 3 deletions contrib/docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
!/contrib/client-sdk/rust

.git*
contrib/
examples/
target/
/contrib
/examples
/target
6 changes: 5 additions & 1 deletion contrib/docker/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ FROM alpine:3

RUN apk add libc6-compat libgcc

RUN adduser -D geoprox
RUN \
adduser -D geoprox && \
mkdir -p /var/lib/geoprox/snapshots && \
chown geoprox:geoprox -R /var/lib/geoprox

USER geoprox:geoprox

WORKDIR /usr/local/bin
Expand Down
7 changes: 5 additions & 2 deletions contrib/docker/Dockerfile.debian
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ RUN cargo build --release

FROM debian:bookworm

RUN groupadd geoprox && \
useradd -m -g geoprox geoprox
RUN \
groupadd geoprox && \
useradd -m -g geoprox geoprox && \
mkdir -p /var/lib/geoprox/snapshots && \
chown geoprox:geoprox -R /var/lib/geoprox

USER geoprox:geoprox

Expand Down
19 changes: 19 additions & 0 deletions contrib/docker/dev/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
services:
geoprox:
build:
dockerfile: contrib/docker/Dockerfile.alpine
context: ../../../

environment:
GEOPROX_CONFIG: /var/lib/geoprox/geoprox.toml
GEOPROX_HTTP_ADDR: 0.0.0.0
GEOPROX_HTTP_PORT: 5000

ports:
- 5000:5000
volumes:
- ./geoprox.toml:/var/lib/geoprox/geoprox.toml:ro
- snapshots:/var/lib/geoprox/snapshots

volumes:
snapshots:
15 changes: 15 additions & 0 deletions contrib/docker/dev/geoprox.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[server]
http_addr = '0.0.0.0'
http_port = 5000
timeout = '10s'

[shard]
insert_depth = 6
search_depth = 6
default_count = 100
default_sorted = false

[server.snapshots]
disabled = false
path = '/var/lib/geoprox/snapshots'
every = '30s'
2 changes: 1 addition & 1 deletion contrib/docker/quickstart/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
openapi.json
/snapshots
openapi.json

0 comments on commit dcb9c1a

Please sign in to comment.