Skip to content

Commit

Permalink
Add: Configurações do docker e criação do banco de dados
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffersonSenaa committed Dec 18, 2024
1 parent c57d25b commit 3c10ece
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:3.10-slim

WORKDIR /app

COPY . .

RUN pip install --no-cache-dir -r requirements.txt

CMD ["python3", "velho-oeste/main.py"]
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: '3.10'

services:
python:
build:
context: .
dockerfile: Dockerfile
depends_on:
- postgres
environment:
- DATABASE_URL=postgresql://velho_oeste_user:vopassword@postgres:5432/velho_oeste_db
volumes:
- .:/app

postgres:
image: postgres:latest
container_name: velho-oeste-postgres
environment:
POSTGRES_USER: velho_oeste_user
POSTGRES_PASSWORD: vopassword
POSTGRES_DB: velho_oeste_db
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data

volumes:
postgres_data:

0 comments on commit 3c10ece

Please sign in to comment.