Build config into nginx
parent
d496e8ac81
commit
d3da212ecc
32
Dockerfile
32
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
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Reference in New Issue