mirror of
https://github.com/FoxxMD/context-mod.git
synced 2026-05-11 03:00:42 -04:00
refactor(docker): Improve data directory flexibility and build order
* Create data directory if not /config * Copy s6 files in base to make incremental builds faster
This commit is contained in:
13
Dockerfile
13
Dockerfile
@@ -75,7 +75,7 @@ RUN apk add --no-cache \
|
||||
&& apk del .build-deps \
|
||||
# smoke tests
|
||||
&& node --version \
|
||||
&& npm --version \
|
||||
&& npm --version
|
||||
#
|
||||
# end of docker node stuff
|
||||
#
|
||||
@@ -87,12 +87,11 @@ RUN echo "http://dl-4.alpinelinux.org/alpine/v3.14/community" >> /etc/apk/reposi
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
ARG data_dir=/config
|
||||
#RUN mkdir -p $data_dir && \
|
||||
# chown -R abc:abc $data_dir && \
|
||||
# chmod 755 $data_dir
|
||||
VOLUME $data_dir
|
||||
ENV DATA_DIR=$data_dir
|
||||
|
||||
COPY docker/root/ /
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
FROM base as build
|
||||
@@ -110,7 +109,9 @@ FROM base as app
|
||||
|
||||
COPY --from=build --chown=abc:abc /app /app
|
||||
|
||||
RUN npm install --production && npm cache clean --force
|
||||
RUN npm install --production \
|
||||
&& npm cache clean --force \
|
||||
&& chown abc:abc node_modules
|
||||
|
||||
ENV NPM_CONFIG_LOGLEVEL debug
|
||||
|
||||
@@ -124,5 +125,3 @@ EXPOSE $PORT
|
||||
# convenience variable for more helpful error messages
|
||||
ENV IS_DOCKER=true
|
||||
|
||||
COPY docker/root/ /
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
# used https://github.com/linuxserver/docker-plex as a template
|
||||
|
||||
# make data folder if not /config
|
||||
#if [ ! -d "${DATA_DIR}" ]; then \
|
||||
#mkdir -p "${DATA_DIR}"
|
||||
#chown -R abc:abc /config
|
||||
#fi
|
||||
if [ ! -d "${DATA_DIR}" ]; then \
|
||||
mkdir -p "${DATA_DIR}"
|
||||
chown -R abc:abc /config
|
||||
fi
|
||||
|
||||
# permissions
|
||||
chown abc:abc \
|
||||
|
||||
Reference in New Issue
Block a user