Multiple ports in docker

hey i have a svelte and go app in a docker contianer ( tldr -> my i have django(1st contianer successfully deployed), go and svelte app( another contianer), Django app makes api calls to the golang server that writes to the svelte files; I am porting this here form aws, here is my repo link ->https://github.com/MONISHSHARMA080/deploy_first_website-to_fly/ ) I want to serve my svelte app on the default port(80) and go on 4696(any thing else will be fine too ) but when i deploy it i set the PORT variable to be 4696 and i get the go server( live here ->https://deployfirstwebsite-tofly-production.up.railway.app/), but when it is 80 i get nothing in return , and also how am I able to serve both the apps on different ports
GitHub
GitHub - MONISHSHARMA080/deploy_first_website-to_fly
Contribute to MONISHSHARMA080/deploy_first_website-to_fly development by creating an account on GitHub.
3 Replies
Percy
Percy5mo ago
Project ID: c23d8b15-2401-4d00-91df-984ae1ce228f
PixelPioneer
PixelPioneerOP5mo ago
project id -> c23d8b15-2401-4d00-91df-984ae1ce228f
Brody
Brody5mo ago
you would want to adopt a more conventional project structure, a monorepo would be best for this, your structure would look something like this -
.
├── frontend/
│ ├── src/
│ ├── Dockerfile
│ ├── package.json
│ ├── package-lock.json
│ └── ...
└── backend/
├── a.go
├── Dockerfile
├── go.mod
├── go.sum
└── ...
.
├── frontend/
│ ├── src/
│ ├── Dockerfile
│ ├── package.json
│ ├── package-lock.json
│ └── ...
└── backend/
├── a.go
├── Dockerfile
├── go.mod
├── go.sum
└── ...
this is going to be a far better project structure than throwing everything in the same folder. let me know when you have made these changes and then we can proceed.
Want results from more Discord servers?
Add your server