Skip to content
This repository was archived by the owner on Jun 8, 2022. It is now read-only.
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
10 changes: 6 additions & 4 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
MYSQLDB_ROOT_PASSWORD=PASSWORD
MYSQLDB_DATABASE=RPG
MYSQLDB_LOCAL_PORT=3306
NODE_ENV=development

DB_PROVIDER_URL=mysql://USER:PASSWORD@HOST:PORT/DATABASE

PORT=3000
PORT=3000
MYSQL_HOST=mysqldb
DB_PROVIDER_URL=mysql://root:${MYSQLDB_ROOT_PASSWORD}@${MYSQL_HOST}:${MYSQLDB_LOCAL_PORT}/${MYSQLDB_DATABASE}
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM node:lts-bullseye-slim

WORKDIR /rpg
COPY package.json .
RUN npm install
COPY . .
RUN npx prisma generate
RUN node_modules/.bin/next build
CMD node_modules/.bin/next start
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ Quando o projeto estiver minimamente finalizado, um guia será disponibilizado p
- Prisma como tecnologia ORM
- Banco de dados relacional MySQL
- Socket.io para comunicação em tempo real entre o servidor e o cliente

### Instalação local via Docker
- Instale o Docker e o Docker compose e rode o comando: docker compose build && docker-compose run rpg npx prisma migrate deploy && && docker-compose up -d

- Acesse o endereço: http://127.0.0.1:3000
32 changes: 32 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: '3.8'

services:
mysqldb:
image: mysql:5.7
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=${MYSQLDB_ROOT_PASSWORD}
- MYSQL_DATABASE=${MYSQLDB_DATABASE}
ports:
- ${MYSQLDB_LOCAL_PORT}:3306
volumes:
- db:/var/lib/mysql
rpg:
depends_on:
- mysqldb
build: .
restart: unless-stopped
ports:
- ${PORT}:3000
environment:
- DB_HOST=mysqldb
- DB_USER=${MYSQLDB_USER}
- DB_PASSWORD=${MYSQLDB_ROOT_PASSWORD}
- DB_NAME=${MYSQLDB_DATABASE}
- DB_PORT=${MYSQLDB_DOCKER_PORT}
- DB_PROVIDER_URL=${DB_PROVIDER_URL}
stdin_open: true
tty: true

volumes:
db:
Loading