Following is my docker compose file.
version: '3'
services:
redis:
image: "redis"
volumes:
- ./redis.conf:/usr/local/etc/redis/redis.conf
- ./redis-volume:/data:rw
command: redis-server /usr/local/etc/redis/redis.conf
service1:
build: .
image: 'myregistry.azurecr.io/myapp:latest'
ports:
- '5500:80'
volumes:
- ./appsettings.json:/app/appsettings.json
command: bash -c 'for file in /app/ClientApp/dist/myapp/main*.js; do sed -i "s|original-text|replaced-text|" $$file; done'
As you can see there is a bash command to replace certain string in some js files. This command is not take effect when I do docker-compose up. There is no error as well. However it works fine if I CLI into the running container and execute the same command (except that off course, I use $file instead of $$file as there is nothing to escape here).
for file in /app/ClientApp/dist/myapp/main*.js; do sed -i "s|original-text|replaced-text|" $file; done
Please suggest what I am doing wrong here.