import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
@Entity('users')
export class User {
@PrimaryGeneratedColumn()
id!: number;
@Column()
email!: string;
@Column()
password!: string;
}
version: "3.8"
services:
node:
build:
context: .
dockerfile: Dockerfile
image: node:18
ports:
- "3000:3000"
volumes:
- ./backend:/backend
- /backend/node_modules
working_dir: /backend
command: npm run start
restart: always
FROM node:18
EXPOSE 3000
COPY ./backend ./backend
WORKDIR ./backend
RUN if [ -f yarn.lock ]; then npm i -g yarn && yarn; \
elif [ -f pnpm-lock.yaml ]; then npm i -g pnpm && pnpm i; \
else npm i; \
fi
CMD ["npm","run","start"]