DiscordSaaSBot / SaaSBot

🤖 Discord bot for the builders and entrepreneurs community.
Apache License 2.0
11 stars 3 forks source link

Improve docker compose so that the code is independent of the image #15

Closed adriantoral closed 7 months ago

adriantoral commented 7 months ago

Checking PR #10 and according to #9, the docker container must be independent of the source code. This means that once the image is created, the code it contains should not be modified...

With the current docker-compose.yaml, the service: saasbot creates two volumes, one for the source code and the other for the node_modules folder. This should be avoided due to insecurity regarding version maintenance.

The changes should look like:

version: '3'
services:
  saasbot:
    build: .

    command: node dist/index.js

    environment:
      NODE_ENV: development

    ports:
      - "3000:3000"

Note: The Dockerfile is using COPY . . that copies all the files inside the project folder, including config files and docs; it should only copy required files for the build...

Also, as we said in discord, the Makefile must be replaced with GitHub Actions so it is independent of the machine that host the project...