Skip to content

Commit

Permalink
feat: Add data persistency and improve docs - Docker Compose (EddieHu…
Browse files Browse the repository at this point in the history
  • Loading branch information
Pradumnasaraf authored Jan 27, 2023
1 parent 7e80044 commit d1e0725
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ services:
container_name: mongodb
networks:
- linkfree-network
volumes:
- mongodb:/data/db

networks:
linkfree-network:
driver: bridge

volumes:
mongodb:
32 changes: 27 additions & 5 deletions pages/docs/environments/local-development-docker-compose.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,39 @@ import Link from "../../../components/Link";

## Local development with Docker Compose

This environment is on your computer but with containers (for example MongoDB) supporting your environment.
This environment will allow you tu run the application locally with Docker Compose. Everything will be run in containers (for example MongoDB), so you don't need to install anything on your machine.

### Prerequisites

You will need <Link href="https://docs.docker.com/compose/">Docker and Docker Compose</Link> installed.
You will need <Link href="https://docs.docker.com/compose/">Docker and Docker Compose v2</Link> installed.

### Commands
### Setup

1. `docker compose up`
1) Make sure you have cloned the repository and are in the root of the project.

Full details coming soon.
2) Execute the following command, this will build the images and start the containers.

```bash
docker compose up
```

3) You can now access the application at `http://localhost:3000`.

4) If you making any changes to the dependencies, it's recommended to rebuild the images with the following command.

```bash
docker compose up --build
```

5) If you want to stop the containers, you can use the following command.

```bash
docker compose down
```

### Troubleshooting

If you getting an error, first try to rebuild the images with `docker compose up --build`. If that doesn't work, stop the containers with `docker compose down` and then remove the stopped linkfree container with `docker rm linkfree`. Then remove the images with `docker rmi linkfree-app`. Then rebuild the images with `docker compose up --build`.

export default ({ children }) => (
<DocsLayout title="LinkFree Local Development with Docker Compose Documentation">
Expand Down

0 comments on commit d1e0725

Please sign in to comment.