Open Sourced kumar.now.sh
kumarabhirup / dockerized Goto Github PK
View Code? Open in Web Editor NEWBoilerplate to start with Docker setup (Next.js included)
License: MIT License
Boilerplate to start with Docker setup (Next.js included)
License: MIT License
Open Sourced kumar.now.sh
Thanks a lot Kumar for your tutorial.
I am fairly new to Docker and encounter some issues to browse the website.
I am running docker on my windows 10 Home with Docker tools.
When I execute docker-compose, I got the following error.
remid@LAPTOP-MINGW64 /c/users/remid/dockerized (master)
$ docker-compose up
Starting dockerized_nextjs_1 ... done Attaching to dockerized_nextjs_1
nextjs_1 | npm ERR! code ENOENT
nextjs_1 | npm ERR! syscall open
nextjs_1 | npm ERR! path /usr/src/app/package.json
nextjs_1 | npm ERR! errno -2
nextjs_1 | npm ERR! enoent ENOENT: no such file or directory, open '/usr/src/app/package.json'
nextjs_1 | npm ERR! enoent This is related to npm not being able to find a file.
nextjs_1 | npm ERR! enoent
nextjs_1 |
nextjs_1 | npm ERR! A complete log of this run can be found in:
nextjs_1 | npm ERR! /root/.npm/_logs/2020-03-29T23_25_25_944Z-debug.log
dockerized_nextjs_1 exited with code 254
I have also tried to build the image with docker build with no error:
docker build . project
Step 10/10 : CMD "npm" "run" "dev"
---> Running in 9adcae1ef952
Removing intermediate container 9adcae1ef952
---> ec652f219f51
Successfully built ec652f219f51
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.```
It runs well, I can curl -I http://localhost:3000 with success from the container.
remid@MINGW64 /c/users/remid/dockerized/packages/landingpage (master)
$ docker run ec652f219f51
> [email protected] dev /usr/src/app
> next
[ wait ] starting the development server ...
[ info ] waiting on http://localhost:3000 ...
> Using "webpackDevMiddleware" config function defined in next.config.js.
However, when trying to map the ports, I got the following error:
$ docker run ec652f219f51 -p 3001:3000
[eval]:1
3001:3000
^
SyntaxError: Unexpected token ':'
at new Script (vm.js:88:7)
at createScript (vm.js:263:10)
at Object.runInThisContext (vm.js:311:10)
at Object.<anonymous> ([eval]-wrapper:10:26)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at evalScript (internal/process/execution.js:94:25)
at internal/main/eval_string.js:23:3
Thanks for your help.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.