Skip to content

Commit

Permalink
feat: docker
Browse files Browse the repository at this point in the history
  • Loading branch information
kauaneiras committed Sep 9, 2024
1 parent 2cf05c8 commit 4c64992
Show file tree
Hide file tree
Showing 40 changed files with 1,627 additions and 331 deletions.
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DB_HOST=alice_postgres
DB_USER=admin
DB_PASSWORD="password"
DB_NAME=Alice
DB_PORT=5432
PORT=3000
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Ignore node_modules, mas mantenha o .env
node_modules/
npm-debug.log
yarn-error.log
package-lock.json
.pnpm-debug.log

# Logs
logs
*.log

# Pastas de build temporárias
dist/
build/

# Imagens ou arquivos de cache temporários
*.tmp
*.temp
*.cache

# Pastas e arquivos Docker (se estiverem gerados localmente)
docker-compose.override.yml
.Dockerfile
.dockerignore

# Ignore arquivos de banco de dados e seed locais
postgres-data/
*.sqlite

# Outros
.DS_Store

# Ignorar arquivos .env.local, mas manter o .env
.env.local
.env.*

# Mantenha o .env no repositório
!.env
53 changes: 42 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,58 @@
version: '3.8'

services:
postgres:
image: postgres:latest
container_name: postgres
database:
image: postgres:13
container_name: alice_postgres
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: password
POSTGRES_DB: mydb
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- postgres-data:/var/lib/postgresql/data
networks:
- backend

app:
build: ./game/backend
container_name: alice_app
environment:
DB_HOST: database
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME}
DB_PORT: ${DB_PORT}
PORT: 3000
ports:
- "3000:3000"
depends_on:
- database
volumes:
- ./game/backend:/usr/src/app
networks:
- backend
command: bash -c "npm install && node src/app.js"

pgadmin:
image: dpage/pgadmin4
container_name: pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: password
PGADMIN_DEFAULT_PASSWORD: admin
ports:
- "8081:80"
- "8080:80"
volumes:
- pgadmin-data:/var/lib/pgadmin
depends_on:
- postgres
- database
networks:
- backend

volumes:
postgres_data:
postgres-data:
pgadmin-data:

networks:
backend:
Binary file added docs/assets/PgAdminQueryDDL.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/entrega1/diagrama_entidade_relacionamento.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ No contexto deste projeto, o DER foi elaborado para capturar a lógica e a estru

## **Diagrama Entidade-Relacionamento**
<center>

![Diagrama Entidade-Relacionamento](../assets/modulo1-DER.png)

Fonte: [Kauan Eiras](https://github.com/kauaneiras), desenvolvido no [BRModelo](https://www.sis4.com/brModelo/)
Expand Down
7 changes: 4 additions & 3 deletions docs/entrega2/DDL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
BEGIN TRANSACTION;

-- Criação da tabela End
CREATE TABLE End (
CREATE TABLE Ending (
end_id SERIAL PRIMARY KEY,
title VARCHAR(150) NOT NULL,
description VARCHAR(300)
description VARCHAR(300),
image BYTEA
);

-- Criação da tabela Adventure
Expand All @@ -31,7 +32,7 @@ CREATE TABLE Adventure (
health INT DEFAULT 50,
size INT DEFAULT 50,
end_id INT,
FOREIGN KEY (end_id) REFERENCES End(end_id)
FOREIGN KEY (end_id) REFERENCES Ending(end_id)
);

-- Criação da tabela Deck
Expand Down
Loading

0 comments on commit 4c64992

Please sign in to comment.