diff --git a/docker-compose.yml b/docker-compose.yml index 907af4a..b3ca6d9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,11 +9,10 @@ services: - ${APP_PORT}:3000 working_dir: /app volumes: - - ./:/app - - ./src/:/app/src - - ./run.sh:/app/run.sh - - ./node_modules:/app/node_modules - - ./next:/app/.next +# - .:/app + - ./node_modules:/app_backup/node_modules +# - ./run.sh:/app/run.sh +# - ./next:/app/.next extra_hosts: - backend.wrenchboard.api.live:10.10.33.15 - backend.wrenchboard.api.test:10.10.33.15 diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh old mode 100644 new mode 100755 diff --git a/docker/Dockerfile b/docker/Dockerfile index e96440b..01ea6c4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -106,18 +106,16 @@ RUN apk add --no-cache --virtual .build-deps-yarn curl gnupg tar \ COPY docker-entrypoint.sh /usr/local/bin/ # ENTRYPOINT ["docker-entrypoint.sh"] +# Create app directory RUN mkdir -p /app -# set working directory +# Set working directory WORKDIR /app -# install app dependencies -COPY package.json /app +# Install app dependencies +COPY package.json /app/ -# add app -COPY . ./app - -# install app dependencies +# Install app dependencies RUN npm install --save RUN npm install react-scripts RUN npm install -g next @@ -125,6 +123,14 @@ RUN npm install sharp RUN npm install react-modal-video 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 [ "npm" ,"run","dev"] \ No newline at end of file +CMD [ "npm" ,"run","dev"]