Docker Compose file not working

Hello! It looks like docker-compose.yml file is corrupted and not starting by use
docker compose up -d

I always get this error:
plasmic-wab-1 | sh: can’t create tmp.json: Permission denied

I believe this command here could not started:

command: |
    jq '(.host = "plasmic-db") | (.password //= "SEKRET")' ormconfig.json > tmp.json && mv tmp.json ormconfig.json && \
    yarn typeorm migration:run && \
    yarn seed && \
    cd /plasmic && \
    yarn dev

This is a part of docker-compose.yml and it could not create tmp.json file by this way.

I am also aware about opening a lot of ports while starting docker compose, since it could be made by using same docker network and refering to containers by it’s name in one network, but it’s fixable in compare the real problem with this tmp.json file and other dirs.

The only way is starting from root, but it’s not safe (adding this in docker container):
user: root

Do you maybe have a solution?

There are no additional istruction in documentation insted of command I use

docker compose up -d

Even after starting a container by running root I get this error inside plasmic-plasmic-wab-1 container:

Created plexus Plexus project sku8iwsELqAmVdbX3sqZff for user admin@admin.example.com
Unbundling with deps sku8iwsELqAmVdbX3sqZff
/plasmic/platform/wab/src/wab/server/util/apm-util.ts:18
logger().info(${name} took ${new Date().getTime() - start}ms${suffix});
^

TypeError: (0 , import_observability.logger) is not a function
at (/plasmic/platform/wab/src/wab/server/util/apm-util.ts:18:7)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async getMigratedBundle (/plasmic/platform/wab/src/wab/server/db/BundleMigrator.ts:159:10)
at async loadDepPackages (/plasmic/platform/wab/src/wab/server/db/DbBundleLoader.ts:57:11)
at async unbundleWithDeps (/plasmic/platform/wab/src/wab/server/db/DbBundleLoader.ts:150:19)
at async PkgMgr.upsertLatest (/plasmic/platform/wab/src/wab/server/pkg-mgr/index.ts:128:18)
at async PkgMgr.unbundleAndSave (/plasmic/platform/wab/src/wab/server/pkg-mgr/index.ts:48:5)
at async PkgMgr.seedPkg (/plasmic/platform/wab/src/wab/server/pkg-mgr/index.ts:81:5)
at async (/plasmic/platform/wab/src/wab/server/db/DbInit.ts:100:37)
at async Promise.all (index 1)

Node.js v24.6.0
error Command failed with exit code 1.
info Visit yarn run | Yarn for documentation about this command.

Docker compose sould be rebuilt.

$ npm run run-ts – src/wab/server/db/DbInit.ts
npm warn Unknown env config “version-commit-hooks”. This will stop working in the next major version of npm.
npm warn Unknown env config “version-tag-prefix”. This will stop working in the next major version of npm.
npm warn Unknown env config “version-git-message”. This will stop working in the next major version of npm.
npm warn Unknown env config “argv”. This will stop working in the next major version of npm.
npm warn Unknown env config “version-git-tag”. This will stop working in the next major version of npm.

wab@0.0.1 run-ts
bash tools/run.bash src/wab/server/db/DbInit.ts

node:internal/modules/cjs/loader:1413
throw err;
^

Error: Cannot find module ‘@/wab/shared/model/classes’
Require stack:

  • /home/webuser/plasmic/platform/wab/src/wab/shared/RuleSetHelpers.ts
  • /home/webuser/plasmic/platform/wab/src/wab/shared/TplMgr.ts
  • /home/webuser/plasmic/platform/wab/src/wab/shared/code-components/variants.ts
  • /home/webuser/plasmic/platform/wab/src/wab/shared/Variants.ts
  • /home/webuser/plasmic/platform/wab/src/wab/shared/component-arenas.ts
  • /home/webuser/plasmic/platform/wab/src/wab/shared/Arenas.ts
  • /home/webuser/plasmic/platform/wab/src/wab/shared/core/components.ts
  • /home/webuser/plasmic/platform/wab/src/wab/shared/codegen/util.ts
  • /home/webuser/plasmic/platform/wab/src/wab/shared/PinManager.ts
  • /home/webuser/plasmic/platform/wab/src/wab/shared/cached-selectors.ts
  • /home/webuser/plasmic/platform/wab/src/wab/shared/SlotUtils.ts
  • /home/webuser/plasmic/platform/wab/src/wab/server/code-components/code-components.ts
  • /home/webuser/plasmic/platform/wab/src/wab/server/db/bundle-migration-utils.ts
  • /home/webuser/plasmic/platform/wab/src/wab/server/db/BundleMigrator.ts
  • /home/webuser/plasmic/platform/wab/src/wab/server/db/DbInit.ts
    at Module. (node:internal/modules/cjs/loader:1410:15)
    at Module._resolveFilename (/home/webuser/plasmic/platform/wab/node_modules/esbuild-register/dist/node.js:4794:36)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1051:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1056:22)
    at Module._load (node:internal/modules/cjs/loader:1219:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:238:24)
    at Module.require (node:internal/modules/cjs/loader:1493:12)
    at require (node:internal/modules/helpers:152:16)
    at Object. (/home/webuser/plasmic/platform/wab/src/wab/shared/RuleSetHelpers.ts:1:40) {
    code: ‘MODULE_NOT_FOUND’,
    requireStack: [
    ‘/home/webuser/plasmic/platform/wab/src/wab/shared/RuleSetHelpers.ts’,
    ‘/home/webuser/plasmic/platform/wab/src/wab/shared/TplMgr.ts’,
    ‘/home/webuser/plasmic/platform/wab/src/wab/shared/code-components/variants.ts’,
    ‘/home/webuser/plasmic/platform/wab/src/wab/shared/Variants.ts’,
    ‘/home/webuser/plasmic/platform/wab/src/wab/shared/component-arenas.ts’,
    ‘/home/webuser/plasmic/platform/wab/src/wab/shared/Arenas.ts’,
    ‘/home/webuser/plasmic/platform/wab/src/wab/shared/core/components.ts’,
    ‘/home/webuser/plasmic/platform/wab/src/wab/shared/codegen/util.ts’,
    ‘/home/webuser/plasmic/platform/wab/src/wab/shared/PinManager.ts’,
    ‘/home/webuser/plasmic/platform/wab/src/wab/shared/cached-selectors.ts’,
    ‘/home/webuser/plasmic/platform/wab/src/wab/shared/SlotUtils.ts’,
    ‘/home/webuser/plasmic/platform/wab/src/wab/server/code-components/code-components.ts’,
    ‘/home/webuser/plasmic/platform/wab/src/wab/server/db/bundle-migration-utils.ts’,
    ‘/home/webuser/plasmic/platform/wab/src/wab/server/db/BundleMigrator.ts’,
    ‘/home/webuser/plasmic/platform/wab/src/wab/server/db/DbInit.ts’
    ]
    }

Node.js v24.6.0

Now I have this error without docker compose when launching:

yarn seed

In the ./platform/wab

Currently I have a problem with non-existing of this file:

src/wab/server/util/observability.ts

I believe I should generate it by yarn something

but still don’t know how to fix it.

I also have this CSRF error:

[frontend] error [HPM] Error occurred while proxying request 192.168.0.198:3003/api/v1/auth/csrf to http://localhost:3004/ [ECONNREFUSED] (Errors | Node.js v24.7.0 Documentation)

The whole guide here

# Run Plasmic App admin locally with self-hosting to edit Medusa frontend  
# Node.js 24.4.0, Python 3.10.13 (or newer)  
# yarn and npm must be installed  
# corepack enable yarn  
# rsync and bash must be installed  
# docker and docker-compose installed and running  
# postgresql-client and postgresql installed and running  

# For Alpine  

# Edit repositories for latest packages (node 24)  
vi /etc/apk/repositories  

# Should be edge  
# https://dl-cdn.alpinelinux.org/alpine/edge/main  
# https://dl-cdn.alpinelinux.org/alpine/edge/community  

apk update && apk upgrade  

apk add postgresql-client build-base python3 py3-pip postgresql postgresql-contrib wget screen rsync python3 nodejs-current openssh neovim docker docker-cli-compose  

rc-update add sshd && rc-service sshd start && rc-update add docker default && service docker start && adduser user  

addgroup webuser docker  
addgroup webuser wheel  

nvim /etc/doas.conf # allow wheel group  

# Build and run steps  

git clone https://github.com/plasmicapp/plasmic.git  
cd plasmic  

# Start database in docker  
docker-compose up -d --no-deps plasmic-db  

# Add .env according to instructions  
echo -e "DATABASE_URI=postgres://wab:SEKRET@localhost:5432/wab\nWAB_DBNAME=plasmic-db\nWAB_DBPASSWORD=SEKRET\nNODE_ENV=development" > .env  

echo -e "DATABASE_URI=postgres://wab:SEKRET@localhost:5432/wab\nWAB_DBNAME=plasmic-db\nWAB_DBPASSWORD=SEKRET\nNODE_ENV=development" > platform/wab/.env  

# Install dependencies in root  
yarn install  

cd platform/wab  

# Fix error with observability logger module  
echo -e "import { PinoLogger } from \"./PinoLogger\";\n\nexport function logger() {\n  return new PinoLogger();\n}" >> src/wab/server/observability/index.ts  

# Install dependencies for wab  
yarn install  

cd ../..  

# Return and configure root beforehand  
yarn setup-all  

cd platform/wab  

# This should pass without errors — the most critical step  
PGHOST=localhost PGPORT=5432 yarn seed  

# If errors occur: yarn typeorm migration:run  
# If errors occur: PGHOST=localhost PGPORT=5432 yarn db:reset  
# If errors occur: PGHOST=localhost PGPORT=5432 yarn db:setup  

cd ../..  

# Configure in root  
yarn setup-all  

# Bootstrap  
yarn bootstrap  

# Run  
yarn dev  

# To run as background process  
nohup yarn dev > dev.log 2>&1 &

Just replace this in server/observabilty/index.ts

This shd resolve your build errors. All the best with other things , for me docker is getting generated locally fine,

import { methodForwarder } from “@/wab/commons/methodForwarder”;
import { Analytics } from “@/wab/shared/observability/Analytics”;
import { PinoLogger } from “./PinoLogger”;

export function initAnalyticsFactory(opts: {
production: boolean;
}): () => Analytics {
return () => methodForwarder();
}

// single instance for the process
const _logger = new PinoLogger();

/**

  • Legacy API: some places import { logger } and call logger()
  • Keep that working by exporting a function that returns the instance.
    */
    export function logger() {
    return _logger;
    }

/**

  • Modern API: import { loggerInstance } and call loggerInstance.info(…)
    */
    export const loggerInstance = _logger;

// Optional: allow import logger from "../observability"
export default _logger;

How do you connect your frontend website to your self-hosted backend ? There are no option to provide a custom plasmic admin pannel address instead of studio.plasmic.app.

I’ve deployed plasmic successfully but still have a problem to connect to it a new plasmic project.

Here is the issue:

yarn create plasmic-app

If your browser doesn't automatically open, enter the following URL:
https://studio.plasmic.app/auth/plasmic-init/****************************

It ask for studio.plasmic.app instead of my localhost:3003 domain.

This environment variable doesn’t help:

PLASMIC_DEFAULT_HOST=http://localhost:3003 yarn create plasmic-app

Using docker everything is built and ran locally. It creates 2 images , one for the wab , and another for db , u can access using one of these ports locally

  - "3003:3003"
  - "3004:3004"
  - "3005:3005"
  - "9229:9229"

Are u able to run it using docker ? and see plasmic login screen via browser ?

I always have this error:

plasmic:~/plasmic$ docker logs plasmic-plasmic-wab-1
sh: can't create tmp.json: Permission denied

I described more info here:

I am currently debugging it.

Hmm i feel this is your local permission issue . Also after cloning you need to modify in that one place plasmic/platform/wab/src/wab/server/observability/index.ts

Then docker-compose up --build

Around 17 things it composes/builds then

Thats about it for me , able to see plasmic running via docker


Thank you so much, here is the further description of the problem I faced:

Now I know the solution.

Since on the last update changed node:18-alpine to node:24-alpine image.
There is a small difference inside containers.

Inside node:24-alpine container there is node user and node group already created. Which means they already have UID and GID 1000, like 1000:1000.

Here when Dockerfile creates a new user plasmic, it creates it with UID and GID 1001, like 1001:1001.

Since, the basice non-root user on the host has UID and GID 1000, plasmic user in the container never inherits all permissions form the main host user with UID 1000.

Just need to replace existing code considering node user deletion and setting 1000 UID and GID for our new plasmic user.

Instead of this one:

Need to put this one:

# Delete container default node user
RUN deluser --remove-home node 2>/dev/null || true && \
    delgroup node 2>/dev/null || true

# Create non-root user with UID 1000 and GID 1000 and prepare env
RUN addgroup -g 1000 plasmic && \
    adduser -u 1000 -G plasmic -S plasmic && \
    apk add --no-cache git jq bash && \
    echo "fs.inotify.max_user_watches=524288" >> /etc/sysctl.conf && \
    sysctl -p && \
    mkdir -p /home/plasmic && \
    chown -R 1000:1000 /home/plasmic

After all this it works properly :slight_smile:

1 Like

This worked for me, too. Since we can’t add issues to the github repo, I am guessing this thread should do the trick? Hoping it gets updated in future versions.

@david_d @EmCmNeDt i can do some updates for either docker file (to update it to node 24 and apply the changes) or update the readme with the solution
I think the first one is more preferred? :slight_smile:
Btw sorry for such a late reply, i’m not sure why this thread wasn’t in my notifications list

Yes, the first is preferred, since node:24-alpine is already in the dockerfile, despite its incompatibility with the default GUID permissions inheritance.

1 Like

@EmCmNeDt, can you create a pull request with all the required changes and send me a link here?

Here was my attempt:
Update Dockerfile to create non-root user with UID 1000 by EmCmEdT · Pull Request #158 · plasmicapp/plasmic

1 Like