Skip to content

Commit 2a21d33

Browse files
committed
feat: add postgres docker config
1 parent d499395 commit 2a21d33

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,9 @@
1717
.idea/
1818
vendor/
1919
.vscode/
20-
tmp/
20+
tmp/
21+
22+
.DS_Store
23+
main
24+
25+
docker/data/

docker/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Use the official PostgreSQL image as the base image
2+
FROM postgres:latest
3+
4+
# Set the environment variables
5+
ENV POSTGRES_USER=myuser
6+
ENV POSTGRES_PASSWORD=mypassword
7+
ENV POSTGRES_DB=mydatabase

docker/docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '3.9'
2+
services:
3+
postgres:
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
container_name: my-postgres
8+
ports:
9+
- "5432:5432"
10+
volumes:
11+
- ./data:/var/lib/postgresql/data

0 commit comments

Comments
 (0)