Hi guys i am having trouble with deploying my ktor...
# server
b
Hi guys i am having trouble with deploying my ktor backend to render via Docker Neither port nor sslPort specified. Use command line options -port/-sslPort or configure connectors in application.conf I am getting this error.
Copy code
# Stage 1: Cache Gradle dependencies
FROM gradle:latest AS cache
RUN mkdir -p /home/gradle/cache_home
ENV GRADLE_USER_HOME=/home/gradle/cache_home
COPY build.gradle.* gradle.properties /home/gradle/app/
COPY gradle /home/gradle/app/gradle
WORKDIR /home/gradle/app
RUN gradle clean build -i --stacktrace

# Stage 2: Build Application
FROM gradle:latest AS build
COPY --from=cache /home/gradle/cache_home /home/gradle/.gradle
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
# Build the fat JAR, Gradle also supports shadow
# and boot JAR by default.
RUN gradle buildFatJar --no-daemon

# Stage 3: Create the Runtime Image
FROM amazoncorretto:22 AS runtime
EXPOSE 8080
RUN mkdir /app
COPY --from=build /home/gradle/src/build/libs/*.jar /app/ktor-docker-sample.jar
ENTRYPOINT ["java","-jar","/app/ktor-docker-sample.jar"]
This is my docker file Thread in Slack Conversation
g
Wow I am working on a Ktor backend project as well and haven't thought of deploying to Render. I'd like to give it a try and see how it goes
b
@God'swill Jonathan i did and my issue is fixed you have to do it via docker
g
@bk9735732777 okay cool... I'd let you know how it goes when I give it a try. I am already using docker and testing locally. Please do you have any documentation or article that I could follow for the deployment on Render that you'd recommend?
1
b
actually if your docker locally is working fine then you just have to add your repo as webservice and deply via docker like select option for Docker and give the path @God'swill Jonathan