Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: '3.8'
services:
app:
container_name: backend
build:
context: ./
dockerfile: Dockerfile
environment:
DATABASE_URI: mongodb+srv://${MONGO_USER}:${MONGO_PASSWORD}@cluster0.keids.mongodb.net/
ports:
- '3000:3000'
depends_on:
- database
database:
image: mongo:6.0
container_name: mongodb
restart: always
ports:
- '27017:27017'
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_ATLAS_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ATLAS_PASSWORD}
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
MONGO_URL="URL"
MONGO_URL="URL"
MONGO_ATLAS_USER="USER"
MONGO_ATLAS_PASSWORD="PASSWORD"
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM node:latest

WORKDIR /usr/src/API

COPY . .
COPY .env /usr/src/API/.env

RUN yarn install --quiet --no-optional --no-fund --loglevel=error

EXPOSE 3000

ENTRYPOINT [ "yarn", "start-dev" ]