This message was deleted.
# ktor
s
This message was deleted.
k
How are you running postgres?
a
Uusing hikaricp
k
I mean, is postgres also running in docker? And if so it is running in the same docker network?
a
No
The postgres is on the server
k
Have you tried running the container with the --network="host" flag?
Or you could also try to substitute localhost with host.docker.internal
a
Copy code
# Use the official gradle image to create a build artifact.
FROM gradle:7-jdk11 as builder

# Copy local code to the container image.
COPY build.gradle.kts .
COPY gradle.properties .
COPY src ./src

# Build a release artifact.
RUN gradle installDist

FROM openjdk:11
EXPOSE 7000:7000
RUN mkdir /app
COPY --from=builder /home/gradle/build/install/gradle /app/
WORKDIR /app/bin
CMD ["./gradle"]
Above is my Dockerfile, where can I insert the
--network="host"
flag?
k
That is part of the run configuration
a
ohk so how can I do now?
k
I haven't used the docker-cli in a while but I imagine it's something like: docker run --network="host" <image>
a
ohk let me try, thank you Sir.
k
For local dev environments I recommend checking out docker-compose https://docs.docker.com/compose/
a
Ohk Sir, thank you.
Hello Sir, the first suggestion for using the network flag works. Thank you so much
­čĹŹ 1