Skip to content

Commit

Permalink
DEAR-71: add docker compose setup on the db (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
smuefsmuef authored Jul 25, 2024
1 parent 0491cf1 commit 3645906
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 24 deletions.
42 changes: 28 additions & 14 deletions .github/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
#docker-compose for server

#version: '3.5'
##docker-compose for server
#version: '3.9'
#services:
#
# frontend:
# container_name: frontend
# image: ghcr.io/24fsiit16/dear-dev-frontend:latest
# restart: always
# # environment:
# # - AUTH_TRUST_HOST=true
# # - NEXTAUTH_URL=00000001
# environment:
# - NEXT_TRUST_HOST=true
# ports:
# - "3000:3000"

#backend:
# container_name: backend
# image: ghcr.io/24fsiit16/dear-dev-backend:latest
# ports:
# - "8080:8080"

#
# db:
# image: postgres:13
# container_name: postgres_db
# environment:
# POSTGRES_USER: ${POSTGRES_USER}
# POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
# ports:
# - "5432:5432"
# volumes:
# - postgres_data:/var/lib/postgresql/data
#
# backend:
# container_name: backend
# image: ghcr.io/24fsiit16/dear-dev-backend:latest
# ports:
# - "8080:8080"
# depends_on:
# - db
#
# nginx:
# container_name: nginx
# image: nginx:latest
Expand All @@ -27,4 +38,7 @@
# - ./nginx.conf:/etc/nginx/nginx.conf
# depends_on:
# - frontend
# - backend
#
#volumes:
# postgres_data:
37 changes: 27 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
This is a [Next.js](https://nextjs.org/) project bootstrapped
with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

Expand All @@ -18,19 +19,35 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the

You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and
load Inter, a custom Google Font.

## Learn More
## Deploy to Server

To learn more about Next.js, take a look at the following resources:
### Make sure to replace your_password_here with your actual password (for db).

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
echo "POSTGRES_USER=user_name_here" >> .env
echo "POSTGRES_PASSWORD=your_password_here" >> .env

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
### Set File Permissions: Set the file permissions to restrict access:

## Deploy on Vercel
chmod 600 .env

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
### create file & copy the docker-compose.yml from .github/workflows/docker-compose.yml into home/yappi

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
### run container..

docker-compose up -d

### stop & remove all containers

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

### remove all images

docker rmi $(docker images -q)

### remove all volumes

docker volume rm $(docker volume ls -q)

0 comments on commit 3645906

Please sign in to comment.