question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I can't create svg with Docker (Debian)

See original GitHub issue

What do you need to create in Debian or Ubuntu?

Docker Image:node:16 https://hub.docker.com/layers/node/library/node/16/images/sha256-1d35d3b639b639fb55d955d271c1da97d9e730c7dc0b9bae352a63c50b7c12c1?context=explore

package.json

{
  "name": "app",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "ts-node-dev --respawn --debug --exit-child src/index.ts",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@prisma/client": "^3.5.0",
    "@types/express": "^4.17.13",
    "@types/node": "^16.11.9",
    "express": "^4.17.1",
    "mermaid.cli": "^0.5.1",
    "ts-node": "^10.4.0",
    "typescript": "^4.5.2"
  },
  "devDependencies": {
    "prisma": "^3.5.0",
    "prisma-erd-generator": "^0.6.1",
    "ts-node-dev": "^1.1.8"
  },
  "prisma": {
    "seed": "ts-node prisma/seed.ts"
  }
}

schema.prisma

// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "mysql"
  url      = env("DATABASE_URL")
}

generator erd {
  provider = "prisma-erd-generator"
  output   = "./ERD.svg"
}

model User {
  id    Int     @id @default(autoincrement())
  email String  @unique
  name  String?
  age   Int?

  createdAt DateTime @default(now()) @map("created_at")
  updatedAt DateTime @default(now()) @map("updated_at")

  profile Profile?
  posts   Post[]

  @@map("users")
}

model Profile {
  id       Int    @id @default(autoincrement())
  nickName String @map("nick_name")

  createdAt DateTime @default(now()) @map("created_at")
  updatedAt DateTime @default(now()) @map("updated_at")

  userId Int  @unique
  user   User @relation(fields: [userId], references: [id])

  @@map("profile")
}

model Post {
  id    Int    @id @default(autoincrement())
  title String @map("title")
  createdAt DateTime @default(now()) @map("created_at")
  updatedAt DateTime @default(now()) @map("updated_at")
  
  userId Int
  user   User @relation(fields: [userId], references: [id])

  @@map("posts")
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mshige1979commented, Nov 27, 2021

ERD

0reactions
mshige1979commented, Nov 27, 2021

It seems that there was an error in mmdc. I recreated a new dockerfile and ran it and it worked.

dockerFile

# base
FROM node:16

# shell
SHELL ["/bin/bash", "-c"]

# env
ENV TZ Asia/Tokyo
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive

# apt update
RUN apt update && \
    apt-get update -qq && \
    apt-get install -y autoconf sudo wget unzip curl vim bzip2 build-essential bison git tzdata cmake

# lib
RUN apt-get install -y \
    libnss3 libatk1.0-0 libatk-bridge2.0-0 \
    libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 \
    libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 \
    libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 \
    libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 \
    libxcb1 libxcomposite1 libxcursor1 libxdamage1 \
    libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 \
    libxss1 libxtst6 ca-certificates fonts-liberation \
    libappindicator1 libnss3 libdrm-dev libdrm2 \
    libgbm-dev libgbm1 libasound2 libasound2-dev libxshmfence1 libxshmfence-dev && \
    apt-get clean && \
    rm -rf /var/cache/apt

# ユーザーを作成
RUN useradd -m app
RUN echo 'app:ampassword' |chpasswd
RUN echo "app ALL=NOPASSWD: ALL" >> /etc/sudoers
USER app

# ホームディレクトリ及び作業ディレクトリ設定
ENV HOME /home/app
RUN mkdir -p $HOME/backend
WORKDIR /home/app/backend

build

docker-compose build
docker-compose up -d
docker-compose run --rm backend npx prisma generate
Read more comments on GitHub >

github_iconTop Results From Across the Web

i can't use svg-sprite with docker · Issue #154 - GitHub
I have a problem when i want install svg-sprite on docker with help npm. When I add svg-sprite to my dependencies and run...
Read more >
ImageMagick on Docker container generated malformed PNG ...
Goal: Trying to convert an SVG file into a PNG within a Docker container. Problem: ImageMagick is generating malformed PNG images in the ......
Read more >
Can't start docker image hosted on Debian 11 VM - Reddit
Hi, I'm trying to host a few docker containers on a Debian 11 VM. I setup debian, made a non-root user (dock) to...
Read more >
Set up an advanced frontend extension - Docker Documentation
The quickest way to create a new extension is to run docker extension init my-extension as in the Quickstart. This will create a...
Read more >
How to enable SVG for php-imagick - Nextcloud community
You can create a new docker image based on the official Nextcloud image to add extra features. FROM nextcloud:21-fpm RUN apt-get update &&...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found