2 years ago
I'm trying to deploy a docker container to railway and it builds with no errors from the dockerfile, but the deploy produces no logs for hours and the service is unavailable. Sometimes after waiting a few hours it'll eventually start but most of the time it just sits with no logs or info coming out of the deploy. Here's the dockerfile I'm using:
FROM haskell:9.4.7-buster
WORKDIR /opt/
RUN apt install --no-install-recommends curl
RUN cabal update
# Add just the .cabal file to capture dependencies
COPY ./.cabal /opt/selene/.cabal
# Docker will cache this command as a layer, freeing us up to
# modify source code without re-installing dependencies
# (unless the .cabal file changes!)
RUN cabal new-build --only-dependencies -j4
# Add and Install Application Code
COPY . /opt/
RUN cabal new-install exe: -j4
CMD [""]18 Replies
Like most of the "deploy" logs for this service are just fully empty. Only when a new deploy doesn't happen for many hours it'll have the start logs from my app show up with a timestamp that's hours after the "deploy" time
2 years ago
please attach the Dockerfile without the needless censoring
sure I didn't think it made a difference
FROM haskell:9.4.7-buster
WORKDIR /opt/selene
RUN apt install --no-install-recommends curl
RUN cabal update
# Add just the .cabal file to capture dependencies
COPY ./selene.cabal /opt/selene/selene.cabal
# Docker will cache this command as a layer, freeing us up to
# modify source code without re-installing dependencies
# (unless the .cabal file changes!)
RUN cabal new-build --only-dependencies -j4
# Add and Install Application Code
COPY . /opt/selene
RUN cabal new-install exe:selene -j4
CMD ["selene"]2 years ago
the little details matter
2 years ago
does this dockerfile build an image and run fine locally?
2 years ago
zero logs what so ever for hours?
2 years ago
how are you logging? are you logging unbuffered to stdout / stderr?
This is the entry point code:
main :: IO ()
main = do
withEnv $ \env -> do
appToRun <- Scotty.scottyAppT (runM env) (app env)
let warpSettings = setPort 3005 defaultSettings
runM env $ do
$logInfo "Selene start at port 3005"
runSettings warpSettings appToRunI'm not super familiar with the internals of the haskell io monad but I was pretty sure this logs unbuffered to stdout, doing some more research now
2 years ago
i am even less familiar
2 years ago
and just to be clear, your service will always stay unavailable, even once the logs do print?
2 years ago
application failed to respond, right? if so, please check out this docs page -