diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..4cff333 --- /dev/null +++ b/.env.example @@ -0,0 +1,6 @@ +# Copy to .env and fill values +MONGO_URI=mongodb://mongo:27017/chatdb +JWT_SECRET=change_this_to_a_random_secret +PORT=4000 +OPENAI_API_KEY= +OTHER_PROVIDER_KEY= diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index 32b46ba..09a7f23 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -7,8 +7,12 @@ services: ports: - "4000:4000" restart: always + env_file: + - ../.env environment: - NODE_ENV=production + depends_on: + - mongo frontend: build: @@ -19,3 +23,14 @@ services: restart: always depends_on: - backend + + mongo: + image: mongo:6 + restart: unless-stopped + volumes: + - mongo-data:/data/db + ports: + - "27017:27017" + +volumes: + mongo-data: