gobuffalo / buffalo

Rapid Web Development w/ Go
http://gobuffalo.io
MIT License
8.08k stars 576 forks source link

Docker first run connection reset #1596

Closed Arsur closed 5 years ago

Arsur commented 5 years ago

Description

I just tried to run the instructions for buffalo within docker and its simply not working. This is my first contact to buffalo so i realy dont know whats not working.

Steps to Reproduce the Problem

I just used this blogpost https://blog.gobuffalo.io/buffalo-docker-images-ff3938dcaa53 which is also linked to the guide at the doc pages.

Expected Behavior

see “Welcome to Buffalo” page at http://localhost:3000

Actual Behavior

i run trough the guide up to the last point

buffalo: 2019/02/19 09:40:55 === Building Completed (PID: 350) (Time: 3.283425587s) ===
buffalo: 2019/02/19 09:40:55 === Running: tmp/coke-build (PID: 432) ===
INFO[2019-02-19T09:40:55Z] Starting application at 127.0.0.1:3000
INFO[2019-02-19T09:40:55Z] Starting Simple Background Worker
Hash: 1188b3f3012b0a0aba11
Version: webpack 4.5.0
Time: 2559ms
Built at: 2019-2-19 09:40:56
                               Asset       Size       Chunks             Chunk Names
674f50d287a8c48dc19ba404d20fe713.eot    162 KiB               [emitted]  
application.932140690571d4d44bcd.css   1.16 MiB  application  [emitted]  application
 application.1188b3f3012b0a0aba11.js    846 KiB  application  [emitted]  application
                  images/favicon.ico   1.12 KiB               [emitted]  
                     images/logo.svg   64.4 KiB               [emitted]  
                       manifest.json  270 bytes               [emitted]  
Entrypoint application = application.932140690571d4d44bcd.css application.1188b3f3012b0a0aba11.js
[./assets/css/application.scss] 39 bytes {application} [built]
[./assets/js/application.js] 126 bytes {application} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 509 bytes {application} [built]
   [0] multi ./node_modules/jquery-ujs/src/rails.js ./assets/css/application.scss ./assets/js/application.js 52 bytes {application} [built]
    + 11 hidden modules
Child mini-css-extract-plugin node_modules/css-loader/index.js??ref--4-1!node_modules/sass-loader/lib/loader.js??ref--4-2!assets/css/application.scss:
    Entrypoint mini-css-extract-plugin = *
    [./node_modules/css-loader/index.js??ref--4-1!./node_modules/sass-loader/lib/loader.js??ref--4-2!./assets/css/application.scss] ./node_modules/css-loader??ref--4-1!./node_modules/sass-loader/lib/loader.js??ref--4-2!./assets/css/application.scss 364 KiB {mini-css-extract-plugin} [built]
        + 9 hidden modules

My Browser just tells me the connection was reset. If i check the port with netstat in my ubuntu its open.

Info

### Buffalo Version
v0.13.13

### App Information
Pwd=/go/src/coke
Root=/go/src/coke
GoPath=/go
Name=coke
Bin=bin/coke
PackagePkg=coke
ActionsPkg=coke/actions
ModelsPkg=coke/models
GriftsPkg=coke/grifts
VCS=git
WithPop=true
WithSQLite=true
WithDep=false
WithWebpack=true
WithYarn=true
WithDocker=true
WithGrifts=true
WithModules=false

### Go Version
go version go1.11.5 linux/amd64

### Go Env
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build039998252=/tmp/go-build -gno-record-gcc-switches"

### Node Version
v8.15.0

### NPM Version
6.4.1

### Yarn Version
1.13.0

### PostgreSQL Version
PostgreSQL Not Found

### MySQL Version
mysql  Ver 15.1 Distrib 10.1.37-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

### SQLite Version
3.16.2 2017-01-06 16:32:41 a65a62893ca8319e89e48b8a38cf8a59c69a8209

### Dep Version
could not find a Gopkg.toml file

### Dep Status
could not find a Gopkg.toml file

### go.mod
module coke
KrasimirDzhagarov commented 5 years ago

I had the same problem. Just set in the .env file this: ADDR=0.0.0.0 PORT=3000 HOST=http://0.0.0.0:$PORT

joshrendek commented 5 years ago

@Arsur can you share the output of curl -v http://localhost:3000/ is?

Shivakishore14 commented 5 years ago

Looks like running buffalo dev command binds to 127.0.0.1 by default. which cannot be accessed outside the container. to fix it you can bind to 0.0.0.0 .

you can bind to 0.0.0.0 by adding ADDR=0.0.0.0 before the buffalo dev command.

ADDR=0.0.0.0 buffalo dev
paganotoni commented 5 years ago

I tried this one inside docker-compose and had the same issue which can be solved by using the ADDR=0.0.0.0 variable suggested here.

thanks @KrasimirDzhagarov @Shivakishore14 !

stanislas-m commented 5 years ago

Closing the issue since a solution was found. It can be nice to add this in the docs, though. :)