Skip to content

Commit e6e6b47

Browse files
committed
master - updated readme
1 parent 72aa072 commit e6e6b47

File tree

8 files changed

+96
-39
lines changed

8 files changed

+96
-39
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Ion Ghițun
3+
Copyright (c) 2025 Ion Ghițun
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 50 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,55 @@
1-
## Portainer with docker-compose
1+
# Portainer Docker Stack
22

3-
### Install notes
3+
This project provides a Docker Compose setup for running Portainer behind nginx and nginx-proxy.
44

5-
- copy `scripts/.env.example` to `scripts/.env` and edit it to match your settings
6-
- change other env variables to your needs
7-
- if necessary modify `scripts/nginx/custom.conf` to match you `DOMAIN_HOST`
8-
- run `sh scripts/start.sh` to start the project
9-
- run `sh scripts/stop.sh` to stop the project
10-
- run `sh scripts/build.sh` to build or rebuild the project
11-
- run `sh scripts/restart.sh` to restarts container
12-
- navigate to `DOMAIN_HOST` to see portainer info
5+
## Prerequisites
136

14-
## Dependencies
7+
- Docker Engine & Docker Compose
8+
- Git
9+
- Linux or Windows WSL2
10+
- A working nginx-proxy network (see [nginx-proxy setup](https://github.com/ionghitun/nginx-proxy))
1511

16-
- `nginx-proxy` - https://github.com/ionghitun/nginx-proxy
12+
## Installation
1713

18-
_Happy Coding!_
14+
1. **Clone the repository**
15+
```bash
16+
git clone https://github.com/ionghitun/portainer.git
17+
cd portainer
18+
```
19+
2. **Copy and configure environment variables**
20+
```bash
21+
cp scripts/.env.example scripts/.env
22+
# Edit other variables in scripts/.env as needed
23+
```
24+
3. **Update virtual host configuration**
25+
- Modify `scripts/nginx/custom.conf` to match your `DOMAIN_HOST`.
26+
4. **Start the project**
27+
```bash
28+
sh scripts/start.sh
29+
```
30+
5. **Access Portainer**
31+
- Open your browser and navigate to your configured `DOMAIN_HOST` (e.g., https://portainer.dev.local).
32+
33+
## Available scripts
34+
35+
```bash
36+
./scripts/start.sh # Start the containers
37+
./scripts/down.sh # Stop the containers
38+
./scripts/build.sh # Build or rebuild the containers
39+
./scripts/restart.sh # Restart the containers
40+
```
41+
42+
## Troubleshooting
43+
44+
- **Docker Issues**: For older versions you might want to remove `COMPOSE_BAKE` from `.env`.
45+
- **Docker Compose Issues**: Please update and ensure you can use `docker compose`, not old version `docker-compose`
46+
47+
## License
48+
49+
This project is licensed under the MIT License. See [LICENSE](LICENSE) for details.
50+
51+
## Contributing
52+
53+
Contributions are welcome! Please open issues or submit pull requests following the repository guidelines.
54+
55+
_Happy Coding_

scripts/.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#name of the stack
2+
COMPOSE_PROJECT_NAME=portainer
3+
4+
#for better build performance
5+
COMPOSE_BAKE=true
6+
17
#images versions to use
28
NGINX_VERSION=latest
39
PORTAINER_VERSION=latest

scripts/build.sh

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
#!/bin/sh
2-
echo "*** Rebuild start ***"
3-
42
cd scripts || exit
53

6-
# Prompt user for input
7-
echo "Want to update images before rebuild? (y/n) [default: y]: "
4+
echo "Want to update images before rebuilding? (y/n) [default: y]: "
85
read UPDATE_IMAGES
96
UPDATE_IMAGES=${UPDATE_IMAGES:-y}
107

11-
# Check user input in a POSIX-compatible way
128
if [ "$UPDATE_IMAGES" = "y" ] || [ "$UPDATE_IMAGES" = "Y" ]; then
9+
echo
10+
echo "===== Updating image... ====="
11+
echo
12+
1313
NGINX_VERSION=$(grep -oP '^NGINX_VERSION=\K.*' .env)
1414
PORTAINER_VERSION=$(grep -oP '^PORTAINER_VERSION=\K.*' .env)
1515

1616
docker pull "nginx:$NGINX_VERSION"
1717
docker pull "portainer/portainer-ce:$PORTAINER_VERSION"
1818
fi
1919

20-
echo "*** Rebuilding application ***"
21-
docker compose -p portainer build --no-cache
22-
docker compose -p portainer up -d
20+
echo
21+
echo "===== Building and starting containers... ====="
22+
echo
23+
24+
docker compose build --no-cache
25+
docker compose up -d
2326

24-
echo "*** Rebuild ended ***"
27+
echo
28+
echo "===== Done! ====="
29+
echo

scripts/down.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
echo
3+
echo "===== Stopping... ====="
4+
echo
5+
6+
cd scripts || exit
7+
docker compose down
8+
9+
echo
10+
echo "===== Done! ====="
11+
echo

scripts/restart.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#!/bin/sh
2-
echo "*** Restarting... ***"
2+
echo
3+
echo "===== Restarting... ====="
4+
echo
35

46
cd scripts || exit
7+
docker compose restart
58

6-
docker compose -p portainer restart
7-
8-
echo "*** Restarted ***"
9+
echo
10+
echo "===== Done! ====="
11+
echo

scripts/start.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#!/bin/sh
2-
echo "*** Starting... ***"
2+
echo
3+
echo "===== Starting... ====="
4+
echo
35

46
cd scripts || exit
7+
docker compose up -d
58

6-
docker compose -p portainer up -d
7-
8-
echo "*** Started ***"
9+
echo
10+
echo "===== Done! ====="
11+
echo

scripts/stop.sh

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

0 commit comments

Comments
 (0)