Changed docker-compose to use the images from dockerhub.

This commit is contained in:
Eduardo Silva 2024-04-08 13:03:40 -03:00
parent cd97a65260
commit 2a3b99abe8
6 changed files with 66 additions and 19 deletions

4
.env.example Normal file
View File

@ -0,0 +1,4 @@
# Configure SERVER_ADDRESS to match the address of the server. If you don't have a DNS name, you can use the IP address.
# A missconfigured SERVER_ADDRESS will cause the app to have CSRF errors.
SERVER_ADDRESS=my_server_address
DEBUG_MODE=False

36
build_and_push.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/bash
IMAGES=(
"eduardosilva/wireguard_webadmin:latest"
"eduardosilva/wireguard_webadmin_cron:latest"
"eduardosilva/wireguard_webadmin_nginx:latest"
)
build_images() {
echo "Starting the build of the images..."
docker-compose -f docker-compose-build.yml build
if [ $? -eq 0 ]; then
echo "Build completed successfully."
else
echo "Error during the image build."
exit 1
fi
}
push_images() {
for IMAGE in "${IMAGES[@]}"; do
echo "Pushing image: $IMAGE..."
docker push "$IMAGE"
if [ $? -eq 0 ]; then
echo "$IMAGE pushed successfully."
else
echo "Error pushing the image: $IMAGE"
exit 1
fi
done
}
build_images
push_images
echo "Build and push operations completed successfully."

18
docker-compose-build.yml Normal file
View File

@ -0,0 +1,18 @@
version: '3'
services:
wireguard-webadmin:
image: eduardosilva/wireguard_webadmin:latest
build:
context: .
wireguard-webadmin-cron:
image: eduardosilva/wireguard_webadmin_cron:latest
build:
context: ./cron
dockerfile: Dockerfile-cron
wireguard-webadmin-nginx:
image: eduardosilva/wireguard_webadmin_nginx:latest
build:
context: .
dockerfile: Dockerfile_nginx

View File

@ -3,8 +3,7 @@ services:
wireguard-webadmin:
container_name: wireguard-webadmin
restart: unless-stopped
build:
context: .
image: eduardosilva/wireguard_webadmin:latest
environment:
- SERVER_ADDRESS=127.0.0.1
- DEBUG_MODE=True
@ -19,7 +18,6 @@ services:
- "51820-51839:51820-51839/udp"
# Ports for port forwarding rules. Add your own ports here if you need them.
- "8080-8089:8080-8089/tcp"
cap_add:
- NET_ADMIN
- SYS_MODULE
@ -31,12 +29,10 @@ services:
wireguard-webadmin-cron:
container_name: wireguard-webadmin-cron
restart: unless-stopped
build:
context: ./cron
dockerfile: Dockerfile-cron
image: eduardosilva/wireguard_webadmin_cron:latest
depends_on:
- wireguard-webadmin
volumes:
static_volume:
static_volume:
wireguard:

View File

@ -3,8 +3,7 @@ services:
wireguard-webadmin:
container_name: wireguard-webadmin
restart: unless-stopped
build:
context: .
image: eduardosilva/wireguard_webadmin:latest
environment:
- SERVER_ADDRESS=${SERVER_ADDRESS}
- DEBUG_MODE=${DEBUG_MODE}
@ -19,7 +18,6 @@ services:
- "51820-51839:51820-51839/udp"
# Ports for port forwarding rules. Add your own ports here if you need them.
- "8080-8089:8080-8089/tcp"
cap_add:
- NET_ADMIN
- SYS_MODULE
@ -31,19 +29,14 @@ services:
wireguard-webadmin-cron:
container_name: wireguard-webadmin-cron
restart: unless-stopped
build:
context: ./cron
dockerfile: Dockerfile-cron
image: eduardosilva/wireguard_webadmin_cron:latest
depends_on:
- wireguard-webadmin
wireguard-webadmin-nginx:
container_name: wireguard-webadmin-nginx
restart: unless-stopped
image: nginx:alpine
build:
context: .
dockerfile: Dockerfile_nginx
image: eduardosilva/wireguard_webadmin_nginx:latest
volumes:
- static_volume:/static
- https_cert:/certificate
@ -52,6 +45,6 @@ services:
- "443:443"
volumes:
static_volume:
static_volume:
https_cert:
wireguard:

View File

@ -129,6 +129,6 @@ STATICFILES_DIRS = [
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
WIREGUARD_WEBADMIN_VERSION = 9605
WIREGUARD_WEBADMIN_VERSION = 9606
from wireguard_webadmin.production_settings import *