From d3da212ecc549ba3b02f88bdb79c33b9ebb29b9f Mon Sep 17 00:00:00 2001 From: Andre Challier Date: Sun, 11 Jan 2026 19:25:32 +0100 Subject: [PATCH] Build config into nginx --- Dockerfile | 32 ++------------------------------ docker-compose.yml | 11 +++-------- 2 files changed, 5 insertions(+), 38 deletions(-) diff --git a/Dockerfile b/Dockerfile index 26c1e35..8fe5707 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,30 +1,2 @@ -FROM php:8.2-fpm - -# Install git and ssh-keygen -RUN apt-get update && \ - apt-get install -y git openssh-client && \ - rm -rf /var/lib/apt/lists/* - -# Set the path to the SSH key pair -ENV SSH_KEY_PATH=/root/.ssh/id_ed25519 - -# Check if the SSH key pair exists -RUN if [ ! -f "$SSH_KEY_PATH" ]; then \ - ssh-keygen -t ed25519 -N "" -f $SSH_KEY_PATH && \ - echo "Generated SSH key pair:" && \ - cat $SSH_KEY_PATH.pub; \ - else \ - echo "Using existing SSH key pair:" && \ - cat $SSH_KEY_PATH.pub; \ - fi - -# Nginx configuration -COPY webhook.php /usr/share/nginx/html/webhook.php -# Entrypoint.sh -COPY 99-init-repos.sh /docker-entrypoint.d/99-init-repos.sh - -# Expose ports -EXPOSE 9000 - -# Fetch repo -CMD ["nginx","-g","daemon: off;"] +FROM nginx:latest +COPY nginx.conf /etc/nginx/conf.d/default.conf diff --git a/docker-compose.yml b/docker-compose.yml index aa28c30..8615994 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,13 +2,12 @@ version: '3.8' services: nginx: - image: nginx:latest + build: + context: . + dockerfile: Dockerfile restart: always volumes: - static-files:/usr/share/nginx/html - configs: - - source: nginx_conf - target: /etc/nginx/conf.d/default.conf networks: - nginx-network depends_on: @@ -36,10 +35,6 @@ services: - GIT_SERVER_DADI_STAGING=${GIT_SERVER_DADI_STAGING} - WEBHOOK_SECRET=${WEBHOOK_SECRET} -configs: - nginx_conf: - file: ./nginx.conf - volumes: static-files: name: ${STATIC_FILES_VOLUME_NAME}