docker command seems to be not working correctly
suryapratap-r
HOBBYOP

10 months ago

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

Solved$10 Bounty

23 Replies

suryapratap-r
HOBBYOP

10 months ago

bump


clashing
FREE

10 months ago

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)


clashing

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)

clashing
FREE

10 months ago

Did that help, suryapratap-r?

If yes, then please mark my initial reply as the solution ✌


clashing
FREE

10 months ago

@SSSuryaa did my solution helped?


suryapratap-r
HOBBYOP

10 months ago

@versatile this did not work


clashing
FREE

9 months ago

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


clashing
FREE

9 months ago

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)


suryapratap-r
HOBBYOP

9 months ago

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


suryapratap-r
HOBBYOP

9 months ago

@versatile does not work


clashing
FREE

9 months ago

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

clashing
FREE

9 months ago

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


clashing
FREE

9 months ago

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).


suryapratap-r
HOBBYOP

9 months ago

added start command in settings, it fixed it


clashing
FREE

9 months ago

Great!!


clashing
FREE

9 months ago

I guess, this thread can now be marked as solved, as my suggestion helped @SSSuryaa ✌️


clashing
FREE

9 months ago

Can you visit the help-station thread, and mark my previous reply (which helped you to solve your query) as the solution for this post!

https://station.railway.com/questions/docker-command-seems-to-be-not-working-c-44ceaf74


clashing
FREE

9 months ago

@SSSuryaa 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


clashing
FREE

9 months ago

Chandrika, can you please have a look at this!


9 months ago

The user needs to mark a particular message as solved.


clashing
FREE

9 months ago

Great. The option might be available there, because many others aren't there


clashing
FREE

9 months ago

@SSSuryaa are you there! Do mark my post as the solution to close this query


clashing
FREE

9 months ago

@SSSuryaa!!


clashing
FREE

9 months ago

I hope @SSSuryaa do mark the solution as I helped him in this thread ✌️


Status changed to Solved angelo-railway 9 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...