I'm trying to build an azure web app using docker-compose. To set the context, I'm trying to deploy a multi-container that has Flask and React (React for the front end and Flask for the back end). The docker-compose file looks like below. I'm getting the following error in the logs when configuring in the deployment center. Please help me with a solution.
docker-compose.yml
version: '3'
services:
api:
build: api
image: .azurecr.io/containergroup:app-flask
command: ["flask", "run", "--host=0.0.0.0"]
volumes:
./api:/backend
environment:
FLASK_ENV=development
FLASK_APP=flask_app.py
ports:
"5000:5000"
client:
build: client
image: .azurecr.io/containergroup:app-react
command: ["npm", "start"]
volumes:
./client:/frontend
environment:
NODE_ENV=development
ports:
'3000:3000'
depends_on:
api
Error:
ERROR - Exception in multi-container config parsing: YamlException: (Line: 11, Col: 9, Idx: 175) - (Line: 11, Col: 23, Idx: 189): Bind mount must start with ${WEBAPP_STORAGE_HOME}.
Related
I am not exactly sure how to go about this. I have an instance in AWS Lightsail that has a static IP for which the IP department granted access to read from MariaDB database. I am using streamlit for my app and have stored my database credentials in a .env file. After, I have copied the file code and dockerized it (running the following command):
docker-compose up --build -d
It is built successfully, but when I use the static IP to look at the web page I get the following error:
OperationalError: (2003, "Can't connect to MySQL server on 'localhost' ([Errno 99] Cannot assign requested address)")
Is there something I have to do either in docker or with MariaDB? Thank you in advance.
File of docker-compose.yml:
version: '3'
services:
app:
container_name: app
restart: always
build: ./app
ports:
- "8501:8501"
command: streamlit run Main.py
database:
image: mariadb:latest
volumes:
- /data/mysql:/var/lib/mysql
restart: always
env_file: .env
nginx:
container_name: nginx
restart: always
build: ./nginx
ports:
- "80:80"
depends_on:
- app
- database
I am not sure how the streamlit app is connected with mariadb here.
I have an app with separated frontend and backend, each one is a subfolder. I have dockerized the front and the back separately in their folders, respectively.
Now, I'm trying to run them in the same network by using docker-compose in the root folder. The build is done successfully, but when I run it, the front container works just fine, but the back container exits with code 0.
Maybe it's worth mentioning that the container of the back is a done with a docker-compose too.
Can you help me please?
Here's how the docker-compose.yml looks like in the root folder
version: '3.7'
services:
back:
build: ./backend/
ports:
- "8000:8000"
front:
build: ./frontend/
ports:
- "80:3000"
output:
app_back_1 exited with code 0
front_1 | INFO: Accepting connections at http://localhost:3000.
Here's the docker-compose file of the backend:
version: '3.5'
services:
app:
build:
context: .
command: gunicorn backend.wsgi:application --bind 0.0.0.0:8000
volumes:
- static_data:/vol/static
ports:
- "8000:8000"
restart: always
env_file:
- .env
depends_on:
- app-db
app-db:
image: postgres:12-alpine
ports:
- "5432:5432"
restart: always
volumes:
- postgres_data:/var/lib/postgresql/data:rw
env_file:
- .env
proxy:
build: ./proxy
volumes:
- static_data:/vol/static
- media_data:/vol/media
restart: always
ports:
- "8008:80"
depends_on:
- app
volumes:
static_data:
media_data:
postgres_data:
If the container runs well, It should run well with identical docker image that you have built. Try docker-compose up --build --force-recreate --no-deps to recreate everything from scratch with no cache, so then if you have error in your source code the error will throw for both standalone container and compose.
I have a Pycharm remote interpreter setup using docker-compose, I am able to run the project fine but when trying to debug I am getting this error:
ERROR: for e21cea317159_my_proj Cannot create container for service myproj: conflicting options: port publishing and the container type network mode
My docker-compose file:
version: '1.0'
services:
my-router:
image: testimage:latest
dns: 10.10.10.10
dns_search:
- testwebsite.com
et:
build:
context: ""
dockerfile: Dockerfile
volumes:
- .:/workarea
depends_on:
- "my-router"
environment:
- WAIT_FOR_PORTS=my-router:12345
network_mode: service:my-router
Thanks for the help!
I'm trying to setup the OSRM server on the top of Docker. I need to configure it using docker-compose.yml in side my micro-services project using .net core.
version: '3.4'
services:
test_web:
image: ${DOCKER_REGISTRY-}osrmweb
build:
context: .
dockerfile: OSRM_WEB/Dockerfile
ports:
- 1111
osrm-data:
image: irony/osrm5
volumes:
- /data
osrm:
image: irony/osrm5
volumes:
- osrm-data
ports:
- 5000:5000
command: ./start.sh Sweden http://download.geofabrik.de/europe/sweden-latest.osm.pbf
I have this docker-compose.yml file. When I run the docker-compose up There is no error but the container is Exited.
I cant see any response in this url.
https://localhost:5000/route/v1/driving/13.388860,52.517037;13.397634,52.529407;13.428555,52.523219?overview=false
Any thing else I need to do in configurations? Any suggestions?
I have the error message:
ERROR: for webapi No such image: sha256:58e2b174484ca40a99ec559bcf6421811d4532cbe009f89d08d430eae9f27050
ERROR: Encountered errors while bringing up the project.
After run commands in Docker Quickstart Terminal:
docker-compose build
docker-compose up -d
It looks like some problems with my image, but I can't find where I should find it. It's built normal and it's throw exception while running my image.
My docker-compose.yml:
version: '2'
services:
webapi:
image: clientpanel
build:
context: ./src/WebApi
dockerfile: Dockerfile
links:
- mongodb
- rabbit
ports:
- "9183:9183"
mongodb:
image: mongo
ports:
- "27017:27017"
rabbit:
container_name: dev_rabbit
hostname: localhost
image: rabbitmq:3.6.8-management
environment:
CLUSTERED: "true"
RABBITMQ_DEFAULT_USER: "guest"
RABBITMQ_DEFAULT_PASS: "guest"
RABBITMQ_DEFAULT_VHOST: "/"
ports:
- "5672:5672"
- "15672:15672"
And my Dockerfile
FROM microsoft/aspnetcore:1.1
ARG source
WORKDIR /app
EXPOSE 80
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "WebApi.dll"]
Remove the stopped service containers using docker-compose rm and then try docker-compose up.
We can see the service containers using docker-compose ps.