mirror of
https://github.com/tiennm99/docker-images.git
synced 2026-10-13 18:15:37 +00:00
Run Couchbase as non-root user and set data volume
Updates the Dockerfile to change ownership of /opt/couchbase/var, declare it as a volume, and run the container as the 'couchbase' user for improved security and data persistence.
This commit is contained in:
1 parent
3fc914a795
commit
e1884fe1a6
1 file changed
+5
@@ -19,7 +19,12 @@ RUN apt-get install -y librtmp0
|
||||
RUN groupadd -g 1000 couchbase && useradd couchbase -u 1000 -g couchbase -M
|
||||
RUN export INSTALL_DONT_START_SERVER=1 && \
|
||||
dpkg -i ./$CB_PACKAGE && rm -f ./$CB_PACKAGE
|
||||
RUN chown -R couchbase:couchbase /opt/couchbase/var
|
||||
|
||||
EXPOSE 8091 8092 11210 11211
|
||||
|
||||
VOLUME /opt/couchbase/var
|
||||
|
||||
USER couchbase
|
||||
|
||||
CMD ["couchbase-server", "--", "-noinput"]
|
||||
Reference in new issue
Block a user