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
23 Replies
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)
10 months ago
Did that help, suryapratap-r?
If yes, then please mark my initial reply as the solution ✌
What is the exact error that you are seeing in the deployed service's build logs on Railway, share that?
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)
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
You can try either of these 2 things:
- Instead of ENDPOINT, use CMD before the serve command in the docker file
- 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
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).
I guess, this thread can now be marked as solved, as my suggestion helped @SSSuryaa ✌️
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
@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
9 months ago
The user needs to mark a particular message as solved.
Great. The option might be available there, because many others aren't there
@SSSuryaa are you there! Do mark my post as the solution to close this query
Status changed to Solved angelo-railway • 9 months ago