I’m building docker with Express Typescript + Postgresql + Minio. I’m having a problem where when I change the code, it doesn’t update the change.
docker-compose.yml:
# **Stage 1: Build (node:alpine)**
FROM node:alpine AS builder
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn
COPY . .
# **Stage 2: Development (node:alpine)**
FROM builder AS dev
WORKDIR /app
EXPOSE 5000
CMD ["yarn", "dev"]```
Dockerfile:
version: “3.9”
services:
server-booking:
build:
context: .
dockerfile: Dockerfile
target: dev
ports:
– “5000:5000”
env_file:
– .env
depends_on:
– minio
– postgres
environment:
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
volumes:
– ./:/app
– /app/node_modules
restart: always
networks:
– my-booking-network
minio:
image: minio/minio:latest
container_name: minio-booking
ports:
– “9000:9000”
– “9001:9001”
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
command: server /data –console-address “:9001”
volumes:
– minio-data:/data
networks:
– my-booking-network
postgres:
image: postgres:latest
container_name: postgres-booking
ports:
– “5432:5432”
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
– postgres-data:/var/lib/postgresql/data
networks:
– my-booking-network
volumes:
minio-data:
driver: local
postgres-data:
driver: local
networks:
my-booking-network:
Please help me. Thank you very much!
I did
docker-compose up –build -d
but it still doesn't work
Jackson Cook is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.