Coder Social home page Coder Social logo

evidence-dev / docker-devenv Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 5.0 39 KB

This repo builds a Docker image whose container instances can be used as a development environment for Evidence projects via a mounted directory

License: MIT License

Dockerfile 16.51% Shell 83.49%

docker-devenv's People

Contributors

hopefan avatar ud3sh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

docker-devenv's Issues

Bind mounted workspace not editable in host.

Both the Alpine and Ubuntu Evidence images use the root user, so the bind mounted workspace directory they create is owned by root and not able to be edited without root privileges in the host.

As a workaround, one can exec into a container shell prompt and do a recursive chown granting ownership to a host user-id and group-id.

403 forbidden when changing database

Hey, I'm facing for a new issue.

I deployed evidence with docker compose, and everything seems ok, but when I'm going to settings to change database, when I choose postgres or else, I put my credentials, when I save them, I got a 403 forbidden error, and on log from chrome I have this:

POST https://my-domain.com/api/settings.json 403 (Forbidden)

But when I'm clickin on thus url i get this:

{
    "settings": {
        "database": "duckdb",
        "credentials": {
            "filename": "needful_things.duckdb",
            "gitignoreDuckdb": null
        }
    },
    "gitIgnore": ".evidence/template\n.svelte-kit\nbuild\nnode_modules\n.DS_Store\n.vscode/settings.json\n"
}

here is my docker-compose file:

version: "3.3"
services:
  evidence:
    image: evidencedev/devenv:ubuntu
    command: "--init"
    restart: always
    environment:
      EVIDENCE_DATABASE: evidence
      EVIDENCE_POSTGRES_USER: postgres
      EVIDENCE_POSTGRES_HOST: postgres
      EVIDENCE_POSTGRES_DATABASE: evidence
      EVIDENCE_POSTGRES_PASSWORD: ${ADMIN_PASSWORD}
      EVIDENCE_POSTGRES_PORT: 5432
    volumes:
      - "./my-project:/evidence-workspace"
    ports:
      - "172.17.0.1:55558:3000"

  postgres:
    image: "elestio/postgres:15"
    container_name: postgres
    restart: always
    environment:
      - "POSTGRES_DB=evidence"
      - "POSTGRES_PASSWORD=${AP_POSTGRES_PASSWORD}"
      - "POSTGRES_USER=postgres"
      - "POSTGRES_HOST_AUTH_METHOD=trust"
    volumes:
      - "./postgres_data:/var/lib/postgresql/data"
    ports:
      - 172.17.0.1:42962:5432

  pgadmin4:
    image: dpage/pgadmin4:latest
    restart: always
    environment:
      PGADMIN_DEFAULT_EMAIL: ${ADMIN_EMAIL}
      PGADMIN_DEFAULT_PASSWORD: ${ADMIN_PASSWORD}
      PGADMIN_LISTEN_PORT: 8080
    ports:
      - "172.17.0.1:17371:8080"
    volumes:
      - ./servers.json:/pgadmin4/servers.json

Thx a lot for your work and for your responses 😊

the container fails, node:events:491

hi,
I started the container, but it fails serving the pages
Any idea what is going wrong and/or how to solve this?

here the output:


[email protected] dev
evidence dev --open / --host 0.0.0.0

npm info using [email protected]
npm info using [email protected]

VITE v4.3.9 ready in 15348 ms

➜ Local: http://localhost:3000/
➜ Network: http://10.0.2.100:3000/
➜ press h to show help
node:events:491
throw er; // Unhandled 'error' event
^

Error: spawn /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe',
path: '/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe',
spawnargs: [
'-NoProfile',
'-NonInteractive',
'–ExecutionPolicy',
'Bypass',
'-EncodedCommand',
'UwB0AGEAcgB0ACAAIgBoAHQAdABwADoALwAvAGwAbwBjAGEAbABoAG8AcwB0ADoAMwAwADAAMAAvACIA'
]
}

Got this error When i run "docker run -v=$(pwd):/evidence-workspace -p=3000:3000 -it --rm evidencedev/devenv:latest --init"

npm http fetch GET 200 https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.3.1.tgz 14771ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/@azure/msal-common/-/msal-common-13.3.1.tgz 14963ms (cache miss)
npm info run [email protected] install node_modules/duckdb node-pre-gyp install --fallback-to-build
npm info run [email protected] install node_modules/lz4 node-gyp rebuild
npm info run [email protected] install node_modules/sqlite3 node-pre-gyp install --fallback-to-build
npm info run [email protected] install node_modules/duckdb-async/node_modules/duckdb node-pre-gyp install --fallback-to-build
npm info run [email protected] install { code: 1, signal: null }
npm info run [email protected] install { code: 0, signal: null }
npm ERR! code 1
npm ERR! path /evidence-workspace/node_modules/lz4
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.10.12 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v18.16.0/node-v18.16.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.16.0/node-v18.16.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v18.16.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.16.0/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/evidence-workspace/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/evidence-workspace/node_modules/lz4/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/evidence-workspace/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/root/.cache/node-gyp/18.16.0/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/18.16.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/evidence-workspace/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/18.16.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/evidence-workspace/node_modules/lz4',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: not found: make
npm ERR! gyp ERR! stack     at getNotFoundError (/evidence-workspace/node_modules/which/which.js:10:17)
npm ERR! gyp ERR! stack     at /evidence-workspace/node_modules/which/which.js:57:18
npm ERR! gyp ERR! stack     at new Promise (<anonymous>)
npm ERR! gyp ERR! stack     at step (/evidence-workspace/node_modules/which/which.js:54:21)
npm ERR! gyp ERR! stack     at /evidence-workspace/node_modules/which/which.js:71:22
npm ERR! gyp ERR! stack     at new Promise (<anonymous>)
npm ERR! gyp ERR! stack     at subStep (/evidence-workspace/node_modules/which/which.js:69:33)
npm ERR! gyp ERR! stack     at /evidence-workspace/node_modules/which/which.js:80:22
npm ERR! gyp ERR! stack     at /evidence-workspace/node_modules/isexe/index.js:42:5
npm ERR! gyp ERR! stack     at /evidence-workspace/node_modules/isexe/mode.js:8:5
npm ERR! gyp ERR! System Linux 5.15.0-92-generic
npm ERR! gyp ERR! command "/usr/local/bin/node" "/evidence-workspace/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /evidence-workspace/node_modules/lz4
npm ERR! gyp ERR! node -v v18.16.0
npm ERR! gyp ERR! node-gyp -v v9.4.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2024-04-03T05_34_03_623Z-debug-0.log

Is there any solution for this

NPM error on container start.

Hi, I tried pulling / running the docker image with the --init flag as described in the README...

cd <path-to-your-evidence-project-root>
docker run -v=$(pwd):/evidence-workspace -p=3000:3000 -it --rm evidencedev/devenv:latest --init

... though it gives me the below npm error:

Starting Evidence.dev development environment mounted on /evidence-workspace in the container.
Provided arguments => --init
Starting with a blank template project.
npm info using [email protected]
npm info using [email protected]
! destination directory is not empty, aborting. Use --force to override
Running command => npm run dev -- --host 0.0.0.0
npm info using [email protected]
npm info using [email protected]
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /evidence-workspace/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/evidence-workspace/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2024-04-17T08_08_41_677Z-debug-0.log

Official image and default project template broken

Official evidence-dev image does not work with default project template.

Steps to reproduce:

  1. --init a new project
  2. run the evidence-dev container
  3. you'll see this error all over the rendered report:

Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /evidence-workspace/node_modules/duckdb/lib/binding/duckdb.node)

Reproduced in multiple environments, most recently Docker Compose running on Debian Buster.

Adding libc6-compat to the image didn't help.

Add a linux/arm64 image for M1/M2 Macs

When running evidencedev/devenv on a Mac, the following warning is displayed:

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

I cant make my docker installation work

Hello!

My name is Miguel, i am making a thesis about code-based BI and im trying different tools. Even if i can install evidence in local, i need to have it on docker for comparisons.
I am not experienced with docker so i dont know why i am getting this troubles on installation.

Any help is appreciated.

evidence docker installation error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.