sharkeatbear
sharkeatbear
PD🧩 Plasmo Developers
Created by sharkeatbear on 11/19/2024 in #🔰newbie
Is there anyway to get the plasmo dev server working in a docker container? pnpm dev works on host
It's nothing against the JS ecosystem, and perhaps Docker is not as 'lightweight' as running it on the host, but that IMO is a fine trade off to be able to run docker-compose up and have all my monorepo dev services spun up including plasmo. I don't disagree all of those tools you mentioned certainly enhance portability, but i'm sure you can understand why I still might opt for a container. If it's not feasible without too much effort then no worries.
13 replies
PD🧩 Plasmo Developers
Created by sharkeatbear on 11/19/2024 in #🔰newbie
Is there anyway to get the plasmo dev server working in a docker container? pnpm dev works on host
Portability, and it is a better developer experience when first spinning up. I just like having consistent environments to develop with. I'm happy to help with any kind of debugging here if need be. Or if it's not possible then I can at least cut my losses.
13 replies
PD🧩 Plasmo Developers
Created by sharkeatbear on 11/19/2024 in #🔰newbie
Is there anyway to get the plasmo dev server working in a docker container? pnpm dev works on host
Hi @Sam I am indeed exposing the port from with in the container. In the Dockerfile i expose the following ports.
EXPOSE 1012
EXPOSE 1815
EXPOSE 1816
EXPOSE 1012
EXPOSE 1815
EXPOSE 1816
1815 is for the HMR and 1816 i think is for the reporting. I then use a docker-compose file.
version: '3.8'
services:
forager:
build:
context: .
target: builder
volumes:
- ./build:/app/build
- ./src:/app/src
- ./assets:/app/assets
- ./package.json:/app/package.json
- ./tailwind.config.js:/app/tailwind.config.js
- ./postcss.config.js:/app/postcss.config.js
- ./tsconfig.json:/app/tsconfig.json
- ./next-env.d.ts:/app/next-env.d.ts
- ./.plasmo:/app/.plasmo
ports:
- "127.0.0.1:1012:1012"
- "127.0.0.1:1815:1815"
- "127.0.0.1:1816:1816"
extra_hosts:
- "host.docker.internal:host-gateway"
# network_mode: "host"
command: pnpm dev
stdin_open: true
tty: true
version: '3.8'
services:
forager:
build:
context: .
target: builder
volumes:
- ./build:/app/build
- ./src:/app/src
- ./assets:/app/assets
- ./package.json:/app/package.json
- ./tailwind.config.js:/app/tailwind.config.js
- ./postcss.config.js:/app/postcss.config.js
- ./tsconfig.json:/app/tsconfig.json
- ./next-env.d.ts:/app/next-env.d.ts
- ./.plasmo:/app/.plasmo
ports:
- "127.0.0.1:1012:1012"
- "127.0.0.1:1815:1815"
- "127.0.0.1:1816:1816"
extra_hosts:
- "host.docker.internal:host-gateway"
# network_mode: "host"
command: pnpm dev
stdin_open: true
tty: true
I try to bing directly to the local network interface. I've also tried leaving it out, but nothing lets me connect to port 1815 or 1816. I've also tried binding to 0.0.0.0 which also doesn't work. I've commented out network_mode: "host" as well because i tried that to no avail. I am on a MacOS if that helps. But i'm genuinely curious if anybody else has got this working. I'm sure i'm missing something dumb. It could be to do with local firewall settings?
13 replies