Build config into nginx

main
Andre Challier 2026-01-11 19:25:32 +01:00
parent d496e8ac81
commit d3da212ecc
2 changed files with 5 additions and 38 deletions

View File

@ -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

View File

@ -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}