Skip to content

Commit 1e50c53

Browse files
committed
fixed postgress database issues
1 parent bd8a7b8 commit 1e50c53

File tree

5 files changed

+22
-64
lines changed

5 files changed

+22
-64
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 15 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,29 @@
11
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2-
// README at: https://github.com/devcontainers/templates/tree/main/src/postgres
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
33
{
4-
"name": "Python 3 & PostgreSQL",
5-
"dockerComposeFile": "docker-compose.yml",
6-
"service": "app",
7-
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
4+
"name": "Python 3",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
87
"features": {
9-
"ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {}
10-
}
8+
"ghcr.io/itsmechlark/features/postgresql:1": {
9+
"version": "16"
10+
}
11+
},
12+
13+
"containerEnv": {
14+
"PGDATA": "/var/lib/postgresql/data",
15+
"PGHOST": "localhost",
16+
"PGUSER": "postgres"
17+
},
1118

1219
// Features to add to the dev container. More info: https://containers.dev/features.
1320
// "features": {},
1421

1522
// Use 'forwardPorts' to make a list of ports inside the container available locally.
16-
// This can be used to network with other containers or the host.
17-
// "forwardPorts": [5000, 5432],
23+
// "forwardPorts": [],
1824

1925
// Use 'postCreateCommand' to run commands after the container is created.
20-
// "postCreateCommand": "pip install --user -r requirements.txt",
26+
"postCreateCommand": "cp .env.example .env",
2127

2228
// Configure tool-specific properties.
2329
// "customizations": {},

.devcontainer/docker-compose.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

INSTRUCTIONS.es.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ $ psql --version
1212
1313
A continuación, revisa el contenido del archivo `./.env` y sigue los pasos que se describen a continuación:
1414

15-
1. Crea una nueva base de datos dentro del motor de Postgres personalizando y ejecutando el siguiente comando: `$ createdb -h localhost -U <username> <db_name>`
16-
2. Conéctate al motor de Postgres para utilizar tu base de datos, manipular tablas y datos: `$ psql -h localhost -U <username> <db_name>`
15+
1. Crea un usuario nuevo para conectarte a tu base de datos: `$ psql -U postgres -c \"CREATE USER gitpod;\"`
16+
2. Crea una nueva base de datos dentro del motor de Postgres personalizando y ejecutando el siguiente comando: `$ psql -U postgres -c \"CREATE DATABASE sample-db OWNER gitpod;\"`
17+
3. Conéctate al motor de Postgres para utilizar tu base de datos, manipular tablas y datos: `$ psql -h localhost -U <username> <db_name>`
1718

1819
> NOTA: Recuerda revisar la información del fichero `./.env` para obtener el `username` y el `db_name`.
1920

INSTRUCTIONS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ $ psql --version
1212
1313
Now, review the contents of the `./.env` file and follow the steps described below:
1414

15-
1. Create a new database within the Postgres engine by customizing and executing the following command: `$ createdb -h localhost -U <username> <db_name>`
16-
2. Connect to the Postgres engine to use your database, manipulate tables and data: `$ psql -h localhost -U <username> <db_name>`
15+
1. Create a new user to connect to your database: `psql -U postgres -c \"CREATE USER gitpod;\"`
16+
2. Create a new database within the Postgres engine by customizing and executing the following command: `psql -U postgres -c \"CREATE DATABASE sample-db OWNER gitpod;\"`
17+
3. Connect to the Postgres engine to use your database, manipulate tables and data: `$ psql -h localhost -U <username> <db_name>`
1718

1819
> NOTE: Remember to check the `./.env` file information to get the `username` and `db_name`.
1920

0 commit comments

Comments
 (0)