I have created a simple Restful CRUD app with NestJS boiler plate template and serving the app on Port 8080. I also have a Postgres instance running in a docker container. I am now trying to deploy this app on Fly.io but I am having a lot of trouble and confusing in doing so.
Below is my docker-compose.yml which is pretty straightforward:
version: '3.8'
services:
api:
container_name: todoapp-api
build:
context: .
dockerfile: Dockerfile
ports:
- 3333:3333
depends_on:
postgresdb:
condition: service_healthy
restart: on-failure
postgres:
image: postgres:13
container_name: postgres_db
ports:
- '5433:5432'
healthcheck:
test: ['CMD-SHELL', 'pg_isready', '-d', 'mydb']
interval: 10s
timeout: 5s
retries: 5
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 123
POSTGRES_DB: nest
volumes:
- ./data:/var/lib/postgresql/data
volumes:
postgres:
And I have this Dockerfile that I created as well:
FROM node:18
WORKDIR /app
COPY . .
RUN npm install
EXPOSE 3333
CMD [ "yarn", "start:migrate:serve" ]
The yarn start:migrate:serve command is simply: "start:migrate:serve": "prisma migrate deploy && yarn start:dev"
I would appreciate some insight as to what I can do to get this app running.
