version: '3.8'
services:
frontend:
image: xxxxxxx/frontend:latest
restart: unless-stopped
pull_policy: always
container_name: react-frontend
ports:
- "80:8008" # Expose the frontend on port 80 of the host - for outside communication
depends_on:
- app
networks:
- appnetwork # Connect frontend to the internal appnetwork
environment:
- REACT_APP_API_SERVER=backender ## http://app:8080
- REMOTE_SERVER=http://app:8080
app:
image: 'ZZZZZ/backend:latest'
restart: unless-stopped
pull_policy: always
container_name: app
ports:
- '8080' # accessible on appnetwork only
depends_on:
- postgres
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/postgres
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=fdsgdsfgdsfgdshfsdfjg
- SPRING_JPA_HIBERNATE_DDL_AUTO=update
- TOMCAT_PORT=8080
networks:
- appnetwork # Use appnetwork for backend communications
$ sudo systemctl restart docker
// затем уже билдdocker build --network=host -t your-image .
docker tag <my_docker_image_id> <username_for_hub>/my_docker_images:latest
docker login
docker push <username_for_hub>/my_docker_images:latest
ports:
- 8085:80
на
- 0.0.0.0:8085:80
netstat -tulpn
docker exec -u 0 database netstat -tulpn
docker logs -f --until=10s container_id