8 Deploying on another Machine

After you have created our docker-compose file, you can easily redeploy the system on another machine by running the same commands on the target machine with the file.

docker login docker-compose -f my-app.yaml up docker logout

Just make sure you pull the image of your app from the online repository:

image: webcodingcenter/wcc-demo:1.0version: '3.7' services: my-mongo: image: mongo ports: - 27017:27017 environment: - MONGO_INITDB_ROOT_USERNAME=admin - MONGO_INITDB_ROOT_PASSWORD=pass volumes: - my-data:/data/db my-mongo-express: image: mongo-express environment: - ME_CONFIG_MONGODB_ADMINUSERNAME=admin - ME_CONFIG_MONGODB_ADMINPASSWORD=pass - ME_CONFIG_OPTIONS_EDITORTHEME=ambiance - ME_CONFIG_MONGODB_SERVER=my-mongo ports: - 8081:8081 my-app: image: webcodingcenter/wcc-demo:1.0 ports: - 80:80 volumes: my-data: driver: local

In case this is a Linux bash on a Windows machine, you need to go to the Docker Desktop settings, and enable integration with your distro in "Resources -> WSL Integration" (WSL = Windows Subsystem for Linux):