VSCode Frappe Docker error

Hi all,

Following https://github.com/frappe/frappe_docker/tree/develop/development but after running “code .” the below error message is shown.

What steps to have it fixed ?

Did you copy the devcontainer-example directory ro .devcontainer? https://github.com/frappe/frappe_docker/tree/develop/development#bootstrap-containers-for-development

Yes i did cp -R devcontainer-example .devcontainer
Here is the content

cat .devcontainer/docker-compose.yml
version: “3.7”
services:
mariadb:
image: mariadb:10.3
environment:
- MYSQL_ROOT_PASSWORD=123
- MYSQL_USER=root
volumes:
- …/installation/frappe-mariadb.cnf:/etc/mysql/conf.d/frappe.cnf
- mariadb-vol:/var/lib/mysql

Enable PostgreSQL only if you use it, see development/README.md for more information.

postgresql:

image: postgres:11.8

restart: on-failure

environment:

- POSTGRES_PASSWORD=123

volumes:

- postgresql-vol:/var/lib/postgresql/data

redis-cache:
image: redis:alpine

redis-queue:
image: redis:alpine

redis-socketio:
image: redis:alpine

frappe:
image: frappe/bench:latest
command: sleep infinity
volumes:
- …:/workspace:cached
working_dir: /workspace/development
ports:
- “8000-8005:8000-8005”
- “9000-9005:9000-9005”

volumes:
mariadb-vol:
postgresql-vol:

Can start manually as per the instructions
docker-compose -f .devcontainer/docker-compose.yml up -d
docker exec -e “TERM=xterm-256color” -w /workspace/development -it devcontainer_frappe_1 bash

But when trying VSCode the same error.
Now doing the manually process to install frappe and later see again.

I’m not facing any issue, I am able to use devcontainers.

Seems when installing Docker- compose should be this way

sudo curl -L "https://github.com/docker/compose/releases/download/1.27.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

instead of doing via snap. After doing so VSCode is starting… but long time now waiting… might need to restart docker or even Ubuntu

Thanks again for the support.

When the initiation completes you’ll see README file in sidebar file tree.

Enter into new integrated terminal.

Not finishing… Had to do manually frappe and erpnext install…
Will continue to check what’s wrong and if solution found will share .

@revant_one just to inform that i have managed to have it running but on another machine… still struggling with the original Laptop and even the Samples from VsCode not running…

Nevertheless thanks for the support. Now one question as i need to add this library M2crypto so the steps i did were:

  1. created Dockerfile and inside
FROM python:3.7
RUN apt-get update
RUN apt-get install -y build-essential
RUN apt-get install -y python3-dev
RUN apt-get install -y swig
RUN pip install m2crypto

had to change the docker-compose.yml and added
services:
web:
build: .

When starting it rebuilds and i see running the instructions from Dockerfile but was not included on Frappe env. What is missing or maybe not making the right change to have this library included?

add m2crypto as part of your app’s requirements.txt

You need to checkout how docker layered builds work. keep that layer part of your custom app.

Thanks but even on a VM gives an error so I have to install manually due to the extra libraries required to compile…

Thanks for the support.