From de34618a7c1f151369a80e6e1e313aad86e00f68 Mon Sep 17 00:00:00 2001 From: Divlo Date: Tue, 30 Aug 2022 17:57:29 +0200 Subject: [PATCH] chore: simplify Docker setup --- Dockerfile | 3 +-- README.md | 14 ++------------ docker-compose.yml | 29 ----------------------------- docker-start.sh | 4 ---- 4 files changed, 3 insertions(+), 47 deletions(-) delete mode 100644 docker-compose.yml delete mode 100755 docker-start.sh diff --git a/Dockerfile b/Dockerfile index 33e70ae..0375ed3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,10 +13,9 @@ FROM node:16.17.0 AS runner WORKDIR /usr/src/app ENV NODE_ENV=production COPY --from=builder /usr/src/app/node_modules ./node_modules -COPY --from=builder /usr/src/app/docker-start.sh ./docker-start.sh COPY --from=builder /usr/src/app/package.json ./package.json COPY --from=builder /usr/src/app/email ./email COPY --from=builder /usr/src/app/build ./build COPY --from=builder /usr/src/app/prisma ./prisma USER node -CMD ["./docker-start.sh"] +CMD ["node", "build/index.js"] diff --git a/README.md b/README.md index 9d79f47..fd1afd7 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,8 @@ the root of the project (see `.env.example`). ### Local Development environment +Recommended to use [VSCode: Remote development in Containers](https://code.visualstudio.com/docs/remote/containers-tutorial). + #### Setup the database ```sh @@ -76,18 +78,6 @@ npm run dev npm run prisma:studio ``` -### Production environment with [Docker](https://www.docker.com/) - -```sh -# Setup and run all the services for you -docker-compose up --build -``` - -#### Services started - -- API : `http://localhost:8080` -- [PostgreSQL database](https://www.postgresql.org/) - ## 💡 Contributing Anyone can help to improve the project, submit a Feature Request, a bug report or diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 4b7135d..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: '3.0' -services: - thream-api: - container_name: ${COMPOSE_PROJECT_NAME} - build: - context: './' - env_file: - - '.env' - ports: - - '${PORT}:${PORT}' - depends_on: - - 'thream-database' - volumes: - - './uploads:/usr/src/app/uploads' - restart: 'unless-stopped' - - thream-database: - container_name: 'thream-database' - image: 'postgres:14.2' - environment: - POSTGRES_USER: 'user' - POSTGRES_PASSWORD: 'password' - POSTGRES_DB: 'thream' - volumes: - - 'database-volume:/var/lib/postgresql/data' - restart: 'unless-stopped' - -volumes: - database-volume: diff --git a/docker-start.sh b/docker-start.sh deleted file mode 100755 index c3c8e8e..0000000 --- a/docker-start.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -npm run prisma:migrate:deploy -node build/index.js