FROM nginx:alpine

# Copy custom nginx configuration
COPY nginx.conf /etc/nginx/nginx.conf

# Create directories for HLS streaming
RUN mkdir -p /var/www/media/hls

# Set proper permissions
RUN chown -R nginx:nginx /var/www/media

# Expose HTTP port
EXPOSE 80

# Start nginx
CMD ["nginx", "-g", "daemon off;"]