diff --git a/backend/dockerfile b/backend/Dockerfile similarity index 81% rename from backend/dockerfile rename to backend/Dockerfile index 0f2cca2..3e9ce51 100644 --- a/backend/dockerfile +++ b/backend/Dockerfile @@ -4,5 +4,6 @@ RUN corepack enable && corepack prepare pnpm@latest --activate COPY package.json pnpm-*.yaml ./ RUN pnpm install --frozen-lockfile COPY . . +RUN pnpm build EXPOSE 3000 -CMD [ "pnpm", "start" ] \ No newline at end of file +CMD [ "pnpm", "start:prod" ] \ No newline at end of file diff --git a/backend/package.json b/backend/package.json index c348abc..7e661ba 100644 --- a/backend/package.json +++ b/backend/package.json @@ -11,7 +11,7 @@ "start": "nest start", "start:dev": "nest start --watch", "start:debug": "nest start --debug --watch", - "start:prod": "node dist/main", + "start:prod": "node dist/src/main", "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix", "test": "jest", "test:watch": "jest --watch", diff --git a/docker-compose.yml b/docker-compose.yml index af57012..a334e03 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,28 +18,25 @@ services: volumes: - neuro_postgres_db:/var/lib/postgresql/data restart: always + backend: container_name: neuro_backend build: ./backend - stdin_open: true environment: - - DATABASE_HOST='db' - - DATABASE_PORT=${DATABASE_PORT} - - DATABASE_USERNAME=${DATABASE_USER} - - DATABASE_PASSWORD=${DATABASE_PASSWORD} - - DATABASE_DB=${DATABASE_NAME} + - DATABASE_PORT=5432 + - DATABASE_HOST=db + env_file: + - .env networks: - labnet - volumes: - - ./backend:/app - - /app/node_modules ports: - 3000:3000 depends_on: - db + restart: always volumes: neuro_postgres_db: driver: local networks: - labnet: {} \ No newline at end of file + labnet: