a year ago
I have an nodejs express application, in which I am using slack bolt framework to create an slack bolt in conjunction with Nodejs app, I want to expose two ports one for express app, and one for slack bolt app for events from slack
ⓘ Deployment information is only viewable by project members and Railway employees.
8 Replies
a year ago
What is stopping you from doing this?
https://docs.railway.app/guides/public-networking#target-ports
a year ago
I am continously receiving this error on exposing multiple ports
Attachments
a year ago
For future reference it would be very beneficial for you to include the issue in the root post so anyone who helps you isn't left guessing on the issue.
Please read this docs section -
https://docs.railway.app/guides/healthchecks-and-restarts#configure-healthcheck-port
a year ago
Public Networking | Railway Docs
Here the documentation says, "If your app listens on multiple ports, you're provided with a list to choose from.", But I am not seeing any port on the dashboard.
For reference my docker file is
# Stage 1: Build Stage
FROM node:18-alpine AS build
# Create and set the working directory
WORKDIR /usr/src/app
# Copy the package.json and package-lock.json to install dependencies
COPY package*.json ./
# Install only production dependencies
RUN npm install --production
# Copy the entire source code to the container
COPY . .
# Stage 2: Production Stage
FROM node:18-alpine
# Create and set the working directory for the production stage
WORKDIR /usr/src/app
# Copy only the necessary files from the build stage
COPY --from=build /usr/src/app /usr/src/app
# Expose the port the app runs on
EXPOSE 4000 4001
# Command to run the app
CMD ["npm", "start"]
Attachments
a year ago
How, Can you please share some detailed information,
I have two envs in my app
PORT
SLACK_APP_PORT
How will railway detect these two ports? And should I assign two domains to each port, as doc only mentioned one env that is PORT
a year ago
You are more than welcome to set your own port.
Any update?
a year ago
Sorry about that, I had assumed your service was on the new runtime but it was not, my apologies.
I have moved the service over to the new runtime and now you can select from either of the two ports when adding a domain.
Attachments