diff --git a/README.md b/README.md index 04bf7df..1dbf436 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,14 @@ # Alpine :: InfluxDB Run InfluxDB based on Alpine Linux. Small, lightweight, secure and fast 🏔️ +## Volumes +* **/influxdb/etc** - Directory of config.yml +* **/influxdb/var** - Directory of all mutable data + ## Run ```shell docker run --name influxdb \ - -v .../etc:/influxdb/etc \ + -v .../etc/config.yml:/influxdb/etc/config.yml \ -v .../var:/influxdb/var \ -d 11notes/influxdb:[tag] ``` diff --git a/amd64.dockerfile b/amd64.dockerfile index 6ceadd4..f1f29ff 100644 --- a/amd64.dockerfile +++ b/amd64.dockerfile @@ -17,8 +17,10 @@ # :: prepare image RUN set -ex; \ mkdir -p ${APP_ROOT}; \ - ln -s /etc/influxdb2 ${APP_ROOT}/etc; \ - ln -s /var/lib/influxdb2 ${APP_ROOT}/var; \ + mkdir -p ${APP_ROOT}/etc; \ + mkdir -p ${APP_ROOT}/var; \ + rm -f /etc/defaults/influxdb2/config.yml; \ + ln -s ${APP_ROOT}/etc/config.yml /etc/defaults/influxdb2/config.yml; \ mv /entrypoint.sh /usr/local/bin; # :: copy root filesystem changes and add execution rights to init scripts @@ -34,10 +36,11 @@ chown -R 1000:1000 \ ${APP_ROOT} \ /etc/influxdb2 \ - /var/lib/influxdb2; + /var/lib/influxdb2 \ + /etc/defaults/influxdb2; # :: Volumes - VOLUME ["${APP_ROOT}/etc", "${APP_ROOT}/var"] + VOLUME ["${APP_ROOT}/var"] # :: Monitor HEALTHCHECK CMD /usr/local/bin/healthcheck.sh || exit 1 diff --git a/rootfs/influxdb/etc/config.yml b/rootfs/influxdb/etc/config.yml new file mode 100644 index 0000000..4e44960 --- /dev/null +++ b/rootfs/influxdb/etc/config.yml @@ -0,0 +1,3 @@ +bolt-path: /influxdb/var/influxd.bolt +engine-path: /influxdb/var/engine +nats-port: 4222 \ No newline at end of file