Attmpt fixes on docker build/volume map

This commit is contained in:
2024-12-29 14:45:29 +08:00
parent 334c3ec5c2
commit 38f5d62a6d
3 changed files with 18 additions and 13 deletions
+4 -5
View File
@@ -9,11 +9,10 @@ services:
- ${APP_PORT}:3000 - ${APP_PORT}:3000
working_dir: /app working_dir: /app
volumes: volumes:
- ./:/app # - .:/app
- ./src/:/app/src - ./node_modules:/app_backup/node_modules
- ./run.sh:/app/run.sh # - ./run.sh:/app/run.sh
- ./node_modules:/app/node_modules # - ./next:/app/.next
- ./next:/app/.next
extra_hosts: extra_hosts:
- backend.wrenchboard.api.live:10.10.33.15 - backend.wrenchboard.api.live:10.10.33.15
- backend.wrenchboard.api.test:10.10.33.15 - backend.wrenchboard.api.test:10.10.33.15
Regular → Executable
View File
+14 -8
View File
@@ -106,18 +106,16 @@ RUN apk add --no-cache --virtual .build-deps-yarn curl gnupg tar \
COPY docker-entrypoint.sh /usr/local/bin/ COPY docker-entrypoint.sh /usr/local/bin/
# ENTRYPOINT ["docker-entrypoint.sh"] # ENTRYPOINT ["docker-entrypoint.sh"]
# Create app directory
RUN mkdir -p /app RUN mkdir -p /app
# set working directory # Set working directory
WORKDIR /app WORKDIR /app
# install app dependencies # Install app dependencies
COPY package.json /app COPY package.json /app/
# add app # Install app dependencies
COPY . ./app
# install app dependencies
RUN npm install --save RUN npm install --save
RUN npm install react-scripts RUN npm install react-scripts
RUN npm install -g next RUN npm install -g next
@@ -125,6 +123,14 @@ RUN npm install sharp
RUN npm install react-modal-video RUN npm install react-modal-video
RUN npm install wowjs RUN npm install wowjs
# Bundle app source
COPY . /app
RUN cp -a /app/. /app_backup
RUN chmod a+x /usr/local/bin/docker-entrypoint.sh
EXPOSE 3000
ENTRYPOINT [ "/usr/local/bin/docker-entrypoint.sh" ]
#CMD ["sh", "-c", "next build && next start"] #CMD ["sh", "-c", "next build && next start"]
CMD [ "npm" ,"run","dev"] CMD [ "npm" ,"run","dev"]