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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:16-alpine3.13
WORKDIR /app
COPY package*.json ./
RUN npm ci --production
COPY src/ .
EXPOSE 3000/tcp
CMD [ "npm", "start" ]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Gabriel-API
33 changes: 33 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: '3.9'

services:
gabriel-api:
image: gabriel-api:latest
build:
context: .
environment:
- MONGODB_CONNECTION_URI=mongodb://mongo:27017
- MONGODB_DATABASE=gabriel
- TOKEN=TOKEN
volumes:
- ./:/app:cached
- /app/node_modules
depends_on:
- mongo
ports:
- 3000:3000

mongo:
image: mongo
volumes:
- ./init.sh:/init.sh
- ./sessions.json:/sessions.json
- ./games.json:/games.json
- ./users.json:/users.json
ports:
- 27017:27017

networks:
gabriel:
external: true
name: gabriel
7 changes: 7 additions & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
mongo gabriel --eval 'db.game.drop()'
mongo gabriel --eval 'db.session.drop()'
mongo gabriel --eval 'db.user.drop()'
mongoimport --db gabriel --collection game --jsonArray --file games.json
mongoimport --db gabriel --collection session --jsonArray --file sessions.json
mongoimport --db gabriel --collection user --jsonArray --file users.json
Loading