docker-compose: how to update volumes?

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

I have a docker-compose.yml defined as: version: “2” services: espn-ffb: container_name: espn-ffb depends_on: – espn-ffb-db build: context: . args: APP_DIR: /opt/espn-ffb CONFIG_DIR: /etc/opt/espn-ffb LOG_BASE_DIR: /var/log/espn-ffb environment: – POSTGRES_DB=${POSTGRES_DB} – POSTGRES_USER=${POSTGRES_USER} – POSTGRES_PASSWORD=${POSTGRES_PASSWORD} – POSTGRES_HOST=espn-ffb-db – POSTGRES_PORT=5432 volumes: – ./espn_ffb:/opt/espn-ffb/espn_ffb # Store web logs in a local host directory – ./docker/data/logs/web:/var/log/espn-ffb # Store web logs in a named Docker volume # – espn_ffb_logs:${LOG_BASE_DIR} ports: – 5000:5000 restart: unless-stopped espn-ffb-db: image: postgres:12-alpine container_name: espn-ffb-db environment: – POSTGRES_DB=${POSTGRES_DB} – POSTGRES_USER=${POSTGRES_USER} – POSTGRES_PASSWORD=${POSTGRES_PASSWORD} volumes: # Store db data in a local host directory – ./docker/data/db:/var/lib/postgresql/data # Store db data in a named Docker volume # – espn_ffb_db:/var/lib/postgresql/data ports: – 5432:5432 restart: unless-stopped Locally, I do development on files in ./espn_ffb. After making changes to my local folder, I would like my docker volume (/opt/espn-ffb/espn_ffb) to be updated so that my changes can be reflected. What’s the best way to do this? I came across a few posts suggesting to do docker-compose down followed by docker-compose up -V, but my service is actually part of multiple other services defined in the same docker-compose.yml. I really don’t want to recreate the volume for the other services, I would just like the volume for espn-ffb to be updated so that my changes can be reflected. Dockerfile for reference: FROM python:3-alpine # Install required packages for building app dependencies RUN apk add –no-cache gcc linux-headers musl-dev pcre-dev postgresql-dev && pip3 install –no-cache-dir uwsgi RUN addgroup -S app && adduser -S -G app app ARG LOG_BASE_DIR RUN mkdir -p ${LOG_BASE_DIR} ARG APP_DIR WORKDIR ${APP_DIR} COPY requirements.txt ./ RUN pip3 install –no-cache-dir -r requirements.txt ENV CONFIG_DIR=${CONFIG_DIR} COPY docker/scripts/* ./ COPY conf/espn-ffb-docker.ini ${CONFIG_DIR}/espn-ffb.ini EXPOSE 5000 CMD uwsgi –ini ${CONFIG_DIR}/espn-ffb.ini submitted by /u/raphattack [link] [comments]

X ITM Cloud News

Patricia

Leave a Reply

Next Post

application.properties in kubernetes

Wed Sep 16 , 2020
Spread the love          So as you may or may not know, many popular Java frameworks use .properties files to store configuration like app name, database passwords etc. So for production, I need to pass a application-prod.properties file to the application. Since this file contains secrets, do I mount the whole file […]
X- ITM

Cloud Computing – Consultancy – Development – Hosting – APIs – Legacy Systems

X-ITM Technology helps our customers across the entire enterprise technology stack with differentiated industry solutions. We modernize IT, optimize data architectures, and make everything secure, scalable and orchestrated across public, private and hybrid clouds.

This image has an empty alt attribute; its file name is x-itmdc.jpg

The enterprise technology stack includes ITO; Cloud and Security Services; Applications and Industry IP; Data, Analytics and Engineering Services; and Advisory.

Watch an animation of  X-ITM‘s Enterprise Technology Stack

We combine years of experience running mission-critical systems with the latest digital innovations to deliver better business outcomes and new levels of performance, competitiveness and experiences for our customers and their stakeholders.

X-ITM invests in three key drivers of growth: People, Customers and Operational Execution.

The company’s global scale, talent and innovation platforms serve 6,000 private and public-sector clients in 70 countries.

X-ITM’s extensive partner network helps drive collaboration and leverage technology independence. The company has established more than 200 industry-leading global Partner Network relationships, including 15 strategic partners: Amazon Web Services, AT&T, Dell Technologies, Google Cloud, HCL, HP, HPE, IBM, Micro Focus, Microsoft, Oracle, PwC, SAP, ServiceNow and VMware

.

X ITM