#docker command seems to be not working correctly

21 messages · Page 1 of 1 (latest)

manic solar
#

my project: https://github.com/Suryapratap-R/cc-hub

deploy log


out CLI

Usage:

  out [command]

Available Commands:

  migrate     Executes app DB migration scripts

  serve       Starts the web server (default to 127.0.0.1:8090 if no domain is specified)

  superuser   Manage superusers


Flags:

      --dev                    enable dev mode, aka. printing logs and sql statements to the console

      --dir string             the PocketBase data directory (default "pb_data")

      --encryptionEnv string   the env variable whose value of 32 characters will be used 

                               as encryption key for the app settings (default none)

  -h, --help                   help for out

      --queryTimeout int       the default SELECT queries timeout in seconds (default 30)

  -v, --version                version for out

 

Use "out [command] --help" for more information about a command.

this should only happen when serve command is not working, this is working fine locally

project Id: 6b8d34b2-5176-42dd-84d5-2fb2c9ae7542

GitHub

Contribute to Suryapratap-R/cc-hub development by creating an account on GitHub.

deep vectorBOT
#

Project ID: 6b8d34b2-5176-42dd-84d5-2fb2c9ae7542

manic solar
#

bump

astral tendonBOT
#

New reply sent from Help Station thread:

I guess there are some corrections need to be done in your DockerFile (thanks for providing it beforehand in the GitHub repo):
Change line 17 from
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /app/pocketbase_app .
to
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /app/out .
Change line 32 from
COPY --from=builder /app/pocketbase_app .
to
COPY --from=builder /app/out .
And finally, do this for line 37
ENTRYPOINT [ "./pocketbase_app", "serve", "--http=0.0.0.0:8080" ]
to
ENTRYPOINT [ "./out", "serve", "--http=0.0.0.0:8080" ]
Do let me know if that works or not (make sure to update the docker image which you are using in the Railway service)

You're seeing this because this thread has been automatically linked to the Help Station thread.

astral tendonBOT
#

New reply sent from Help Station thread:

Did that help,
suryapratap-r
?
If yes, then please mark my initial reply as the solution

You're seeing this because this thread has been automatically linked to the Help Station thread.

warm jacinth
#

@manic solar did my solution helped?

manic solar
#

@warm jacinth this did not work

warm jacinth
#

What is the exact error that you are seeing in the deployed service's build logs on Railway, share that?

warm jacinth
#

For my above suggestions, did you change the PORT number to the correct one (to the port at which your server is listening)?

Also, you can try this: ENTRYPOINT [ "./out", "serve", "--host", "0.0.0.0", "--port", "8080" ]
(Change the port number according to your needs)

manic solar
#

tl;dr: serve arg does not seem to be passed

there is no error, just that ./out is running but serve is not seems to be passing or giving command

deploy logs

Mounting volume on: /var/lib/containers/railwayapp/bind-mounts/8705a2a2-aebd-41ee-8d16-8326636f86af/vol_tmqgenhl81l9x5xf

Starting Container

out CLI

 

Usage:

  out [command]

 

Available Commands:

  migrate     Executes app DB migration scripts

  serve       Starts the web server (default to 127.0.0.1:8090 if no domain is specified)

  superuser   Manage superusers

 

Flags:

      --dev                    enable dev mode, aka. printing logs and sql statements to the console

      --dir string             the PocketBase data directory (default "pb_data")

      --encryptionEnv string   the env variable whose value of 32 characters will be used 

                               as encryption key for the app settings (default none)

  -h, --help                   help for out

      --queryTimeout int       the default SELECT queries timeout in seconds (default 30)

  -v, --version                version for out

 

Use "out [command] --help" for more information about a command.

docker build -t cc-hub . && docker run -it --rm cc-hub is working fine in local

manic solar
#

@warm jacinth does not work

warm jacinth
# manic solar <@497266877580574720> does not work

You can try either of these 2 things:

  1. Instead of ENDPOINT, use CMD before the serve command in the docker file
  2. Remove/comment-out the server command from the Dockerfile, & in the Start Command for that Railway-service, and add serve --http=0.0.0.0:8080 there. You can find the start command option by going to the settings tab of the service
warm jacinth
#

If this doesn't work, then someone else can help you, as I have specified all workarounds that I know

#

I have imported your GitHub repository into my Railway project. After debugging, I found that the server returns a 502 timeout error (which you can see in the HTTP LOGS section of the deployment).

manic solar
#

added start command in settings, it fixed it

warm jacinth
warm jacinth
warm jacinth
#

@manic solar are you able to see the option to mark the solution on the help station? Because I cannot see any option to reply, edit, or drop an emoji on this particular thread in help station

warm jacinth
#

Chandrika, can you please have a look at this!

wary fulcrum
#

The user needs to mark a particular message as solved.