Posts

Showing posts with the label docker-compose

Install node_modules inside Docker container and synchronize them with host

Install node_modules inside Docker container and synchronize them with host I have the problem with installing node_modules inside the Docker container and synchronize them with the host. My Docker's version is 18.03.1-ce, build 9ee9f40 and Docker Compose's version is 1.21.2, build a133471 . node_modules 18.03.1-ce, build 9ee9f40 1.21.2, build a133471 My docker-compsose.yml looks like: docker-compsose.yml # Frontend Container. frontend: build: ./app/frontend volumes: - ./app/frontend:/usr/src/app - frontend-node-modules:/usr/src/app/node_modules ports: - 3000:3000 environment: NODE_ENV: ${ENV} command: npm start # Define all the external volumes. volumes: frontend-node-modules: ~ My Dockerfile : Dockerfile # Set the base image. FROM node:10 # Create and define the working directory. RUN mkdir /usr/src/app WORKDIR /usr/src/app # Install the application's dependencies. COPY package.json ./ COPY package-lock.json ./ RUN npm install The trick with...

How to start specific spring batch job with command line

How to start specific spring batch job with command line I have two configured jobs in my spring boot application. I want to trigger a job manually, using a command in my docker-compose.yml to trigger it. To accomplish this first I disable the batch.job.enabled property in my application.yml: batch: initialize-schema: always job: enabled: false I disable it in order to not allow Spring to execute my jobs on application startup. I'm trying to test my jobs with docker, so in my docker-compose.yml I set this command on my application service to execute when my container is up: command: java -jar batch-application-1.0-SNAPSHOT.jar -Dspring.batch.job.names=uploadToS3Job date=2018-06-26 type=MyType This command runs the uploadToS3Job with job parameters date and type. uploadToS3Job When I run my application with docker-compose up --build , spring application runs smoothly but the job is not executed, nothing happens, no crash, no nothing. docker-compose up --build But if I s...